16 Jul, 2016

1 commit

  • The Kconfig for this file is:

    drivers/acpi/Kconfig:config ACPI_PCI_SLOT
    drivers/acpi/Kconfig: bool "PCI slot detection driver"

    ...and so it is not built as a module. Hence including module.h
    and everything that comes with it just for the no-op MODULE_LICENSE
    and friends is rather heavy handed.

    The license/author info is found at the top of the file, so we
    just remove the MODULE_LICENSE etc and the include of module.h

    We delete the DRIVER_VERSION macro as well since it is unused.

    Signed-off-by: Paul Gortmaker
    Signed-off-by: Rafael J. Wysocki

    Paul Gortmaker
     

22 Jun, 2016

2 commits

  • Remove the dbg macro and debug module parameter and use
    the generic kernel facility.

    Trivially reduces defconfig object size on x86-64

    $ size drivers/acpi/pci_slot.o*
    text data bss dec hex filename
    880 752 4 1636 664 drivers/acpi/pci_slot.o.new
    935 752 5 1692 69c drivers/acpi/pci_slot.o.old

    Signed-off-by: Joe Perches
    Signed-off-by: Rafael J. Wysocki

    Joe Perches
     
  • Use generic pr_ functions with pr_fmt for info and err.

    This also reduces object size a trivial bit:

    $ size drivers/acpi/pci_slot.o*
    text data bss dec hex filename
    935 752 5 1692 69c drivers/acpi/pci_slot.o.new
    1027 752 5 1784 6f8 drivers/acpi/pci_slot.o.old

    Miscellanea:

    o Remove unnecessary OOM message as k.alloc functions get a generic
    stack dump on OOM
    o Remove unnecessary embedded prefix from a dbg() message

    Signed-off-by: Joe Perches
    Signed-off-by: Rafael J. Wysocki

    Joe Perches
     

08 Jul, 2015

1 commit


06 Jan, 2014

1 commit

  • Includes appropriate header file linux/pci-acpi.h in pci_slot.c
    because functions acpi_pci_slot_enumerate(), acpi_pci_slot_remove()
    and acpi_pci_slot_init() have their prototype declaratons in
    linux/pci-acpi.h.

    This eliminates the following warnings in pci_slot.c:
    drivers/acpi/pci_slot.c:162:6: warning: no previous prototype for ‘acpi_pci_slot_enumerate’ [-Wmissing-prototypes]
    drivers/acpi/pci_slot.c:174:6: warning: no previous prototype for ‘acpi_pci_slot_remove’ [-Wmissing-prototypes]
    drivers/acpi/pci_slot.c:215:13: warning: no previous prototype for ‘acpi_pci_slot_init’ [-Wmissing-prototypes]

    Signed-off-by: Rashika Kheria
    Reviewed-by: Josh Triplett
    Signed-off-by: Rafael J. Wysocki

    Rashika
     

23 Jul, 2013

1 commit

  • Since acpi_pci_slot_enumerate() and acpiphp_enumerate_slots() can get
    the ACPI device handle they need from bus->bridge, it is not
    necessary to pass that handle to them as an argument.

    Drop the second argument of acpi_pci_slot_enumerate() and
    acpiphp_enumerate_slots(), rework them to obtain the ACPI handle
    from bus->bridge and make acpi_pci_add_bus() and
    acpi_pci_remove_bus() entirely symmetrical.

    Tested-by: Mika Westerberg
    Signed-off-by: Rafael J. Wysocki
    Acked-by: Yinghai Lu

    Rafael J. Wysocki
     

13 Apr, 2013

1 commit

  • Currently the pci_slot driver doesn't update PCI slot devices when PCI
    device hotplug event happens, which may cause memory leak and returning
    stale information to user.

    Now the pci_slot driver has been changed as built-in driver, so invoke
    PCI slot enumeration and destroy routines directly from the PCI core.
    And remove ACPI PCI sub-driver related code because it isn't needed
    any more.

    [bhelgas: removed "extern" from function declarations]
    Signed-off-by: Jiang Liu
    Signed-off-by: Yijing Wang
    Signed-off-by: Bjorn Helgaas
    Reviewed-by: Yinghai Lu
    Acked-by: Rafael J. Wysocki
    Cc: Toshi Kani

    Jiang Liu
     

26 Feb, 2013

1 commit

  • Pull PCI changes from Bjorn Helgaas:
    "Host bridge hotplug
    - Major overhaul of ACPI host bridge add/start (Rafael Wysocki, Yinghai Lu)
    - Major overhaul of PCI/ACPI binding (Rafael Wysocki, Yinghai Lu)
    - Split out ACPI host bridge and ACPI PCI device hotplug (Yinghai Lu)
    - Stop caching _PRT and make independent of bus numbers (Yinghai Lu)

    PCI device hotplug
    - Clean up cpqphp dead code (Sasha Levin)
    - Disable ARI unless device and upstream bridge support it (Yijing Wang)
    - Initialize all hot-added devices (not functions 0-7) (Yijing Wang)

    Power management
    - Don't touch ASPM if disabled (Joe Lawrence)
    - Fix ASPM link state management (Myron Stowe)

    Miscellaneous
    - Fix PCI_EXP_FLAGS accessor (Alex Williamson)
    - Disable Bus Master in pci_device_shutdown (Konstantin Khlebnikov)
    - Document hotplug resource and MPS parameters (Yijing Wang)
    - Add accessor for PCIe capabilities (Myron Stowe)
    - Drop pciehp suspend/resume messages (Paul Bolle)
    - Make pci_slot built-in only (not a module) (Jiang Liu)
    - Remove unused PCI/ACPI bind ops (Jiang Liu)
    - Removed used pci_root_bus (Bjorn Helgaas)"

    * tag 'pci-v3.9-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: (51 commits)
    PCI/ACPI: Don't cache _PRT, and don't associate them with bus numbers
    PCI: Fix PCI Express Capability accessors for PCI_EXP_FLAGS
    ACPI / PCI: Make pci_slot built-in only, not a module
    PCI/PM: Clear state_saved during suspend
    PCI: Use atomic_inc_return() rather than atomic_add_return()
    PCI: Catch attempts to disable already-disabled devices
    PCI: Disable Bus Master unconditionally in pci_device_shutdown()
    PCI: acpiphp: Remove dead code for PCI host bridge hotplug
    PCI: acpiphp: Create companion ACPI devices before creating PCI devices
    PCI: Remove unused "rc" in virtfn_add_bus()
    PCI: pciehp: Drop suspend/resume ENTRY messages
    PCI/ASPM: Don't touch ASPM if forcibly disabled
    PCI/ASPM: Deallocate upstream link state even if device is not PCIe
    PCI: Document MPS parameters pci=pcie_bus_safe, pci=pcie_bus_perf, etc
    PCI: Document hpiosize= and hpmemsize= resource reservation parameters
    PCI: Use PCI Express Capability accessor
    PCI: Introduce accessor to retrieve PCIe Capabilities Register
    PCI: Put pci_dev in device tree as early as possible
    PCI: Skip attaching driver in device_add()
    PCI: acpiphp: Keep driver loaded even if no slots found
    ...

    Linus Torvalds
     

16 Feb, 2013

1 commit


13 Feb, 2013

1 commit


25 Sep, 2012

2 commits

  • This patch changes the function signature of walk_root_bridge().

    We can omit _STA, _SEG, and _BBN evaluation by passing not acpi_handle
    but acpi_pci_root. Now that acpi_pci_slot_add() which is the only
    caller of walk_root_bridge() gets acpi_pci_root structure, changing
    signature of walk_root_bridge() is reasonable.

    [bhelgaas: changelog]
    Signed-off-by: Taku Izumi
    Signed-off-by: Bjorn Helgaas

    Taku Izumi
     
  • This patch changes .add/.remove interfaces of acpi_pci_driver.
    In the current implementation acpi_handle is passed as a parameter
    of .add/.remove interface. However, the acpi_pci_root structure
    contains more useful information than just the acpi_handle. This
    enables us to avoid some useless lookups in each acpi_pci_driver.

    Note: This changes interfaces used by acpi_pci_register_driver(), an
    exported symbol. This patch updates all the in-kernel users, but any
    out-of-kernel acpi_pci_register_driver() users will need updates.

    [bhelgaas: changelog]
    Signed-off-by: Taku Izumi
    Signed-off-by: Bjorn Helgaas

    Taku Izumi
     

13 Jan, 2012

1 commit


30 Mar, 2010

1 commit

  • …it slab.h inclusion from percpu.h

    percpu.h is included by sched.h and module.h and thus ends up being
    included when building most .c files. percpu.h includes slab.h which
    in turn includes gfp.h making everything defined by the two files
    universally available and complicating inclusion dependencies.

    percpu.h -> slab.h dependency is about to be removed. Prepare for
    this change by updating users of gfp and slab facilities include those
    headers directly instead of assuming availability. As this conversion
    needs to touch large number of source files, the following script is
    used as the basis of conversion.

    http://userweb.kernel.org/~tj/misc/slabh-sweep.py

    The script does the followings.

    * Scan files for gfp and slab usages and update includes such that
    only the necessary includes are there. ie. if only gfp is used,
    gfp.h, if slab is used, slab.h.

    * When the script inserts a new include, it looks at the include
    blocks and try to put the new include such that its order conforms
    to its surrounding. It's put in the include block which contains
    core kernel includes, in the same order that the rest are ordered -
    alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
    doesn't seem to be any matching order.

    * If the script can't find a place to put a new include (mostly
    because the file doesn't have fitting include block), it prints out
    an error message indicating which .h file needs to be added to the
    file.

    The conversion was done in the following steps.

    1. The initial automatic conversion of all .c files updated slightly
    over 4000 files, deleting around 700 includes and adding ~480 gfp.h
    and ~3000 slab.h inclusions. The script emitted errors for ~400
    files.

    2. Each error was manually checked. Some didn't need the inclusion,
    some needed manual addition while adding it to implementation .h or
    embedding .c file was more appropriate for others. This step added
    inclusions to around 150 files.

    3. The script was run again and the output was compared to the edits
    from #2 to make sure no file was left behind.

    4. Several build tests were done and a couple of problems were fixed.
    e.g. lib/decompress_*.c used malloc/free() wrappers around slab
    APIs requiring slab.h to be added manually.

    5. The script was run on all .h files but without automatically
    editing them as sprinkling gfp.h and slab.h inclusions around .h
    files could easily lead to inclusion dependency hell. Most gfp.h
    inclusion directives were ignored as stuff from gfp.h was usually
    wildly available and often used in preprocessor macros. Each
    slab.h inclusion directive was examined and added manually as
    necessary.

    6. percpu.h was updated not to include slab.h.

    7. Build test were done on the following configurations and failures
    were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
    distributed build env didn't work with gcov compiles) and a few
    more options had to be turned off depending on archs to make things
    build (like ipr on powerpc/64 which failed due to missing writeq).

    * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
    * powerpc and powerpc64 SMP allmodconfig
    * sparc and sparc64 SMP allmodconfig
    * ia64 SMP allmodconfig
    * s390 SMP allmodconfig
    * alpha SMP allmodconfig
    * um on x86_64 SMP allmodconfig

    8. percpu.h modifications were reverted so that it could be applied as
    a separate patch and serve as bisection point.

    Given the fact that I had only a couple of failures from tests on step
    6, I'm fairly confident about the coverage of this conversion patch.
    If there is a breakage, it's likely to be something in one of the arch
    headers which should be easily discoverable easily on most builds of
    the specific arch.

    Signed-off-by: Tejun Heo <tj@kernel.org>
    Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>

    Tejun Heo
     

25 Nov, 2009

1 commit

  • The existing interface only has a pre-order callback. This change
    adds an additional parameter for a post-order callback which will
    be more useful for bus scans. ACPICA BZ 779.

    Also update the external calls to acpi_walk_namespace.

    http://www.acpica.org/bugzilla/show_bug.cgi?id=779

    Signed-off-by: Lin Ming
    Signed-off-by: Bob Moore
    Signed-off-by: Len Brown

    Lin Ming
     

19 Sep, 2009

2 commits


01 Sep, 2009

1 commit

  • Similar to commit b6adc195 (PCI hotplug: acpiphp wants a 64-bit
    _SUN), pci_slot.ko reads and creates sysfs directories based on
    the _SUN method.

    Certain HP platforms return 64 bits in _SUN. This change to
    pci_slot.ko allows us to see the correct sysfs directories.

    Reported-by: Chad Smith
    Cc: stable@kernel.org
    Signed-off-by: Alex Chiang
    Signed-off-by: Len Brown

    Alex Chiang
     

07 Apr, 2009

1 commit

  • If a logical hot unplug (remove) is performed on a physical PCI slot's
    parent bridge, and then pci_slot is unloaded, we will encounter an oops:

    [] kobject_release+0x9a/0x290
    [] ? kobject_release+0x0/0x290
    [] kref_put+0x37/0x80
    [] kobject_put+0x27/0x60
    [] ? pci_destroy_slot+0x3c/0xc0
    [] pci_destroy_slot+0x45/0xc0
    [] acpi_pci_slot_remove+0x5c/0x91 [pci_slot]
    [] acpi_pci_unregister_driver+0x4b/0x62
    [] acpi_pci_slot_exit+0x10/0x12 [pci_slot]
    [] sys_delete_module+0x161/0x250

    We need to grab a reference to the parent PCI bus, which will pin
    the bus and prevent it from being released until pci_slot is unloaded.

    Cc: lenb@kernel.org
    Reviewed-by: Kenji Kaneshige
    Tested-by: Kenji Kaneshige
    Reported-by: Kenji Kaneshige
    Signed-off-by: Alex Chiang
    Signed-off-by: Jesse Barnes

    Alex Chiang
     

24 Oct, 2008

1 commit

  • * 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6: (123 commits)
    dock: make dock driver not a module
    ACPI: fix ia64 build warning
    ACPI: hack around sysfs warning with link order
    ACPI suspend: fix build warning when CONFIG_ACPI_SLEEP=n
    intel_menlo: fix build warning
    panasonic-laptop: fix build
    ACPICA: Update version to 20080926
    ACPICA: Add support for zero-length buffer-to-string conversions
    ACPICA: New: Validation for predefined ACPI methods/objects
    ACPICA: Fix for implicit return compatibility
    ACPICA: Fixed a couple memory leaks associated with "implicit return"
    ACPICA: Optimize buffer allocation procedure
    ACPICA: Fix possible memory leak, error exit path
    ACPICA: Fix fault after mem allocation failure in AML parser
    ACPICA: Remove unused ACPI register bit definition
    ACPICA: Update version to 20080829
    ACPICA: Fix possible memory leak in acpi_ns_get_external_pathname
    ACPICA: Cleanup for internal Reference Object
    ACPICA: Update comments - no functional changes
    ACPICA: Update for Reference ACPI_OPERAND_OBJECT
    ...

    Linus Torvalds
     

23 Oct, 2008

1 commit

  • Slot detection drivers can co-exist with hotplug drivers. The names
    of the detected/claimed slots may be different depending on module
    load order.

    For legacy reasons, we need to allow hotplug drivers to override
    the slot name if a detection driver is loaded first (and they find
    the same slots).

    Creating and overriding slot names should be an atomic operation,
    otherwise you get a locking nightmare as various drivers race to
    call pci_create_slot().

    pci_create_slot() is already serialized by grabbing the pci_bus_sem.

    We update the API and add a 'hotplug' param, which is:

    set if the caller is a hotplug driver
    NULL if the caller is a detection driver

    pci_create_slot() does not actually use the 'hotplug' parameter in this
    patch. A later patch will add the logic that uses it.

    Cc: kristen.c.accardi@intel.com
    Cc: matthew@wil.cx
    Acked-by: Kenji Kaneshige
    Signed-off-by: Alex Chiang
    Signed-off-by: Jesse Barnes

    Alex Chiang
     

11 Oct, 2008

1 commit

  • As of version 2.0, ACPI can return 64-bit integers. The current
    acpi_evaluate_integer only supports 64-bit integers on 64-bit platforms.
    Change the argument to take a pointer to an acpi_integer so we support
    64-bit integers on all platforms.

    lenb: replaced use of "acpi_integer" with "unsigned long long"
    lenb: fixed bug in acpi_thermal_trips_update()

    Signed-off-by: Matthew Wilcox
    Signed-off-by: Len Brown

    Matthew Wilcox
     

29 Jul, 2008

1 commit


23 Jul, 2008

1 commit

  • Juha Leppnen noticed that an error path in register_slot() wasn't
    returning appropriately, leading to a condition where we might access a
    kfree'ed pointer, so let's fix that.

    Additionally, fix up the copyright information in the file while
    we're in there.

    Signed-off-by: Alex Chiang
    Signed-off-by: Jesse Barnes

    Alex Chiang
     

11 Jun, 2008

1 commit

  • Detect all physical PCI slots as described by ACPI, and create entries in
    /sys/bus/pci/slots/.

    Not all physical slots are hotpluggable, and the acpiphp module does not
    detect them. Now we know the physical PCI geography of our system, without
    caring about hotplug.

    [kaneshige.kenji@jp.fujitsu.com: export-kobject_rename-for-pci_hotplug_core]
    Signed-off-by: Kenji Kaneshige
    Acked-by: Greg KH
    [akpm@linux-foundation.org: build fix]
    [akpm@linux-foundation.org: fix build with CONFIG_DMI=n]
    Signed-off-by: Alex Chiang
    Cc: Greg KH
    Cc: Kristen Carlson Accardi
    Cc: Len Brown
    Acked-by: Len Brown
    Acked-by: Kenji Kaneshige
    Signed-off-by: Andrew Morton
    Signed-off-by: Andrew Morton
    Signed-off-by: Jesse Barnes

    Alex Chiang