17 Oct, 2013

1 commit

  • Two functions defined in device_pm.c, acpi_dev_pm_add_dependent()
    and acpi_dev_pm_remove_dependent(), have no callers and may be
    dropped, so drop them.

    Moreover, they are the only functions adding entries to and removing
    entries from the power_dependent list in struct acpi_device, so drop
    that list too.

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     

30 Aug, 2013

2 commits

  • * acpi-hotplug:
    ACPI / hotplug: Remove containers synchronously
    driver core / ACPI: Avoid device hot remove locking issues

    Rafael J. Wysocki
     
  • The current protocol for handling hot remove of containers is very
    fragile and causes acpi_eject_store() to acquire acpi_scan_lock
    which may deadlock with the removal of the device that it is called
    for (the reason is that device sysfs attributes cannot be removed
    while their callbacks are being executed and ACPI device objects
    are removed under acpi_scan_lock).

    The problem is related to the fact that containers are handled by
    acpi_bus_device_eject() in a special way, which is to emit an
    offline uevent instead of just removing the container. Then, user
    space is expected to handle that uevent and use the container's
    "eject" attribute to actually remove it. That is fragile, because
    user space may fail to complete the ejection (for example, by not
    using the container's "eject" attribute at all) leaving the BIOS
    kind of in a limbo. Moreover, if the eject event is not signaled
    for a container itself, but for its parent device object (or
    generally, for an ancestor above it in the ACPI namespace), the
    container will be removed straight away without doing that whole
    dance.

    For this reason, modify acpi_bus_device_eject() to remove containers
    synchronously like any other objects (user space will get its uevent
    anyway in case it does some other things in response to it) and
    remove the eject_pending ACPI device flag that is not used any more.
    This way acpi_eject_store() doesn't have a reason to acquire
    acpi_scan_lock any more and one possible deadlock scenario goes
    away (plus the code is simplified a bit).

    Reported-and-tested-by: Gu Zheng
    Signed-off-by: Rafael J. Wysocki
    Acked-by: Greg Kroah-Hartman
    Acked-by: Toshi Kani

    Rafael J. Wysocki
     

27 Aug, 2013

4 commits

  • * acpi-assorted:
    ACPI / osl: Kill macro INVALID_TABLE().
    earlycpio.c: Fix the confusing comment of find_cpio_data().
    ACPI / x86: Print Hot-Pluggable Field in SRAT.
    ACPI / thermal: Use THERMAL_TRIPS_NONE macro to replace number
    ACPI / thermal: Remove unused macros in the driver/acpi/thermal.c
    ACPI / thermal: Remove the unused lock of struct acpi_thermal
    ACPI / osl: Fix osi_setup_entries[] __initdata attribute location
    ACPI / numa: Fix __init attribute location in slit_valid()
    ACPI / dock: Fix __init attribute location in find_dock_and_bay()
    ACPI / Sleep: Fix incorrect placement of __initdata
    ACPI / processor: Fix incorrect placement of __initdata
    ACPI / EC: Fix incorrect placement of __initdata
    ACPI / scan: Drop unnecessary label from acpi_create_platform_device()
    ACPI: Move acpi_bus_get_device() from bus.c to scan.c
    ACPI / scan: Allow platform device creation without any IO resources
    ACPI: Cleanup sparse warning on acpi_os_initialize1()
    platform / thinkpad: Remove deprecated hotkey_report_mode parameter
    ACPI: Remove the old /proc/acpi/event interface

    Rafael J. Wysocki
     
  • * acpica:
    ACPICA: Update version to 20130725.
    ACPICA: Update names for walk_namespace callbacks to clarify usage.
    ACPICA: Return error if DerefOf resolves to a null package element.
    ACPICA: Make ACPI Power Management Timer (PM Timer) optional.
    ACPICA: Fix divergences of the commit - ACPICA: Expose OSI version.
    ACPICA: Fix possible fault for methods that optionally have no return value.
    ACPICA: DeRefOf operator: Update to fully resolve FieldUnit and BufferField refs.
    ACPICA: Emit all unresolved method externals in a text block
    ACPICA: Export acpi_tb_validate_rsdp().
    ACPI: Add facility to remove all _OSI strings
    ACPI: Add facility to disable all _OSI OS vendor strings
    ACPICA: Add acpi_update_interfaces() public interface
    ACPICA: Update version to 20130626
    ACPICA: Fix compiler warnings for casting issues (only some compilers)
    ACPICA: Remove restriction of 256 maximum GPEs in any GPE block
    ACPICA: Disassembler: Expand maximum output string length to 64K
    ACPICA: TableManager: Export acpi_tb_scan_memory_for_rsdp()
    ACPICA: Update comments about behavior when _STA does not exist

    Rafael J. Wysocki
     
  • * acpi-pm:
    ACPI / PM: Add state information to error message in acpi_device_set_power()
    ACPI / PM: Remove redundant power manageable check from acpi_bus_set_power()
    ACPI / PM: Use ACPI_STATE_D3_COLD instead of ACPI_STATE_D3 everywhere
    ACPI / PM: Make messages in acpi_device_set_power() print device names
    ACPI / PM: Only set power states of devices that are power manageable

    Rafael J. Wysocki
     
  • * acpi-cleanup: (21 commits)
    ACPI / dock: fix error return code in dock_add()
    ACPI / dock: Drop unnecessary local variable from dock_add()
    ACPI / dock / PCI: Drop ACPI dock notifier chain
    ACPI / dock: Do not check CONFIG_ACPI_DOCK_MODULE
    ACPI / dock: Do not leak memory on falilures to add a dock station
    ACPI: Drop ACPI bus notifier call chain
    ACPI / dock: Rework the handling of notifications
    ACPI / dock: Simplify dock_init_hotplug() and dock_release_hotplug()
    ACPI / dock: Walk list in reverse order during removal of devices
    ACPI / dock: Rework and simplify find_dock_devices()
    ACPI / dock: Drop the hp_lock mutex from struct dock_station
    ACPI: simplify acpiphp driver with new helper functions
    ACPI: simplify dock driver with new helper functions
    ACPI: Export acpi_(bay)|(dock)_match() from scan.c
    ACPI: introduce two helper functions for _EJ0 and _LCK
    ACPI: introduce helper function acpi_execute_simple_method()
    ACPI: introduce helper function acpi_has_method()
    ACPI / dock: simplify dock_create_acpi_device()
    ACPI / dock: mark initialization functions with __init
    ACPI / dock: drop redundant spin lock in dock station object
    ...

    Rafael J. Wysocki
     

15 Aug, 2013

1 commit


13 Aug, 2013

3 commits


08 Aug, 2013

1 commit

  • In theory, under a given ACPI namespace node there should be only
    one child device object with _ADR whose value matches a given bus
    address exactly. In practice, however, there are systems in which
    multiple child device objects under a given parent have _ADR matching
    exactly the same address. In those cases we use _STA to determine
    which of the multiple matching devices is enabled, since some systems
    are known to indicate which ACPI device object to associate with the
    given physical (usually PCI) device this way.

    Unfortunately, as it turns out, there are systems in which many
    device objects under the same parent have _ADR matching exactly the
    same bus address and none of them has _STA, in which case they all
    should be regarded as enabled according to the spec. Still, if
    those device objects are supposed to represent bridges (e.g. this
    is the case for device objects corresponding to PCIe ports), we can
    try harder and skip the ones that have no child device objects in the
    ACPI namespace. With luck, we can avoid using device objects that we
    are not expected to use this way.

    Although this only works for bridges whose children also have ACPI
    namespace representation, it is sufficient to address graphics
    adapter detection issues on some systems, so rework the code finding
    a matching device ACPI handle for a given bus address to implement
    this idea.

    Introduce a new function, acpi_find_child(), taking three arguments:
    the ACPI handle of the device's parent, a bus address suitable for
    the device's bus type and a bool indicating if the device is a
    bridge and make it work as outlined above. Reimplement the function
    currently used for this purpose, acpi_get_child(), as a call to
    acpi_find_child() with the last argument set to 'false' and make
    the PCI subsystem use acpi_find_child() with the bridge information
    passed as the last argument to it. [Lan Tianyu notices that it is
    not sufficient to use pci_is_bridge() for that, because the device's
    subordinate pointer hasn't been set yet at this point, so use
    hdr_type instead.]

    This change fixes a regression introduced inadvertently by commit
    33f767d (ACPI: Rework acpi_get_child() to be more efficient) which
    overlooked the fact that for acpi_walk_namespace() "post-order" means
    "after all children have been visited" rather than "on the way back",
    so for device objects without children and for namespace walks of
    depth 1, as in the acpi_get_child() case, the "post-order" callbacks
    ordering is actually the same as the ordering of "pre-order" ones.
    Since that commit changed the namespace walk in acpi_get_child() to
    terminate after finding the first matching object instead of going
    through all of them and returning the last one, it effectively
    changed the result returned by that function in some rare cases and
    that led to problems (the switch from a "pre-order" to a "post-order"
    callback was supposed to prevent that from happening, but it was
    ineffective).

    As it turns out, the systems where the change made by commit
    33f767d actually matters are those where there are multiple ACPI
    device objects representing the same PCIe port (which effectively
    is a bridge). Moreover, only one of them, and the one we are
    expected to use, has child device objects in the ACPI namespace,
    so the regression can be addressed as described above.

    References: https://bugzilla.kernel.org/show_bug.cgi?id=60561
    Reported-by: Peter Wu
    Tested-by: Vladimir Lalov
    Signed-off-by: Rafael J. Wysocki
    Acked-by: Bjorn Helgaas
    Cc: 3.9+ # 3.9+

    Rafael J. Wysocki
     

06 Aug, 2013

2 commits

  • The physical_node_id_bitmap in struct acpi_device is only used for
    looking up the first currently unused dependent phyiscal node ID
    by acpi_bind_one(). It is not really necessary, however, because
    acpi_bind_one() walks the entire physical_node_list of the given
    device object for sanity checking anyway and if that list is always
    sorted by node_id, it is straightforward to find the first gap
    between the currently used node IDs and use that number as the ID
    of the new list node.

    This also removes the artificial limit of the maximum number of
    dependent physical devices per ACPI device object, which now depends
    only on the capacity of unsigend int. As a result, it fixes a
    regression introduced by commit e2ff394 (ACPI / memhotplug: Bind
    removable memory blocks to ACPI device nodes) that caused
    acpi_memory_enable_device() to fail when the number of 128 MB blocks
    within one removable memory module was greater than 32.

    Reported-and-tested-by: Yasuaki Ishimatsu
    Signed-off-by: Rafael J. Wysocki
    Acked-by: Toshi Kani
    Reviewed-by: Yasuaki Ishimatsu

    Rafael J. Wysocki
     
  • Move acpi_bus_get_device() from bus.c to scan.c which allows
    acpi_bus_data_handler() to become static and clean up the latter.

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     

30 Jul, 2013

1 commit


26 Jul, 2013

1 commit

  • We attempted to address a regression introduced by commit a57f7f9
    (ACPICA: Add Windows8/Server2012 string for _OSI method.) after which
    ACPI video backlight support doesn't work on a number of systems,
    because the relevant AML methods in the ACPI tables in their BIOSes
    become useless after the BIOS has been told that the OS is compatible
    with Windows 8. That problem is tracked by the bug entry at:

    https://bugzilla.kernel.org/show_bug.cgi?id=51231

    Commit 8c5bd7a (ACPI / video / i915: No ACPI backlight if firmware
    expects Windows 8) introduced for this purpose essentially prevented
    the ACPI backlight support from being used if the BIOS had been told
    that the OS was compatible with Windows 8 and the i915 driver was
    loaded, in which case the backlight would always be handled by i915.
    Unfortunately, however, that turned out to cause problems with
    backlight to appear on multiple systems with symptoms indicating that
    i915 was unable to control the backlight on those systems as
    expected.

    For this reason, revert commit 8c5bd7a, but leave the function
    acpi_video_backlight_quirks() introduced by it, because another
    commit on top of it uses that function.

    References: https://lkml.org/lkml/2013/7/21/119
    References: https://lkml.org/lkml/2013/7/22/261
    References: https://lkml.org/lkml/2013/7/23/429
    References: https://lkml.org/lkml/2013/7/23/459
    References: https://lkml.org/lkml/2013/7/23/81
    References: https://lkml.org/lkml/2013/7/24/27
    Reported-and-tested-by: James Hogan
    Reported-and-tested-by: Kamal Mostafa
    Reported-and-tested-by: Jörg Otte
    Reported-and-tested-by: Steven Newbury
    Reported-by: Martin Steigerwald
    Reported-by: Kalle Valo
    Tested-by: Joerg Platte
    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     

23 Jul, 2013

3 commits

  • Add new API to allow OSPM to disable/enable specific types of _OSI
    interface strings.

    ACPICA does not have the knowledge about whether an _OSI interface
    string is an OS vendor string or a feature group string and there
    isn't any API interface to allow OSPM to install a new interface
    string as a feature group string.
    This patch simply adds all feature group strings defined by ACPI
    specification into the acpi_default_supported_interfaces with
    ACPI_OSI_FEATURE flag set to fix this gap. This patch also adds
    codes to keep their default states as ACPI_OSI_INVALID before the
    initialization and after the termination.

    Signed-off-by: Lv Zheng
    Reviewed-by: Zhang Rui
    Signed-off-by: Bob Moore
    Acked-by: Len Brown
    Signed-off-by: Rafael J. Wysocki

    Conflicts:
    include/acpi/actypes.h (with commit 242b228)

    Lv Zheng
     
  • Version 20130626.

    Signed-off-by: Bob Moore
    Signed-off-by: Lv Zheng
    Acked-by: Len Brown
    Signed-off-by: Rafael J. Wysocki

    Bob Moore
     
  • The FADT can support over 1000 GPEs, so remove any restriction
    on the GPE numbers.

    Signed-off-by: Bob Moore
    Signed-off-by: Lv Zheng
    Acked-by: Len Brown
    Signed-off-by: Rafael J. Wysocki

    Bob Moore
     

18 Jul, 2013

2 commits

  • According to Matthew Garrett, "Windows 8 leaves backlight control up
    to individual graphics drivers rather than making ACPI calls itself.
    There's plenty of evidence to suggest that the Intel driver for
    Windows [8] doesn't use the ACPI interface, including the fact that
    it's broken on a bunch of machines when the OS claims to support
    Windows 8. The simplest thing to do appears to be to disable the
    ACPI backlight interface on these systems".

    There's a problem with that approach, however, because simply
    avoiding to register the ACPI backlight interface if the firmware
    calls _OSI for Windows 8 may not work in the following situations:
    (1) The ACPI backlight interface actually works on the given system
    and the i915 driver is not loaded (e.g. another graphics driver
    is used).
    (2) The ACPI backlight interface doesn't work on the given system,
    but there is a vendor platform driver that will register its
    own, equally broken, backlight interface if not prevented from
    doing so by the ACPI subsystem.
    Therefore we need to allow the ACPI backlight interface to be
    registered until the i915 driver is loaded which then will unregister
    it if the firmware has called _OSI for Windows 8 (or will register
    the ACPI video driver without backlight support if not already
    present).

    For this reason, introduce an alternative function for registering
    ACPI video, acpi_video_register_with_quirks(), that will check
    whether or not the ACPI video driver has already been registered
    and whether or not the backlight Windows 8 quirk has to be applied.
    If the quirk has to be applied, it will block the ACPI backlight
    support and either unregister the backlight interface if the ACPI
    video driver has already been registered, or register the ACPI
    video driver without the backlight interface otherwise. Make
    the i915 driver use acpi_video_register_with_quirks() instead of
    acpi_video_register() in i915_driver_load().

    This change is based on earlier patches from Matthew Garrett,
    Chun-Yi Lee and Seth Forshee and includes a fix from Aaron Lu's.

    References: https://bugzilla.kernel.org/show_bug.cgi?id=51231
    Tested-by: Aaron Lu
    Tested-by: Igor Gnatenko
    Tested-by: Yves-Alexis Perez
    Signed-off-by: Rafael J. Wysocki
    Reviewed-by: Aaron Lu
    Acked-by: Matthew Garrett

    Rafael J. Wysocki
     
  • Expose acpi_gbl_osi_data so that code outside of ACPICA can check
    the value of the last successfull _OSI call. The definitions for
    OSI versions are moved to actypes.h so that other components can
    access them too.

    Based on a patch from Matthew Garrett which in turn was based on
    an earlier patch from Seth Forshee.

    [rjw: Changelog]
    Signed-off-by: Aaron Lu
    Signed-off-by: Rafael J. Wysocki

    Aaron Lu
     

15 Jul, 2013

8 commits

  • It is quite some time that this one has been deprecated.
    Get rid of it.

    Should some really important user be overseen, it may be reverted and
    the userspace program worked on first, but it is time to do something
    to get rid of this old stuff...

    Signed-off-by: Thomas Renninger
    Acked-by: Matthew Garrett
    Acked-by: Henrique de Moraes Holschuh
    Signed-off-by: Rafael J. Wysocki

    Thomas Renninger
     
  • The only user of the ACPI dock notifier chain is the ACPI-based PCI
    hotplug (acpiphp) driver that uses it to carry out post-dock fixups
    needed by some systems with broken _DCK. However, it is not
    necessary to use a separate notifier chain for that, as it can be
    simply replaced with a new callback in struct acpi_dock_ops.

    For this reason, add a new .fixup() callback to struct acpi_dock_ops
    and make hotplug_dock_devices() execute it for all dock devices with
    hotplug operations registered. Accordingly, make acpiphp point that
    callback to the function carrying out the post-dock fixups and
    do not register a separate dock notifier for each device
    registering dock operations. Finally, drop the ACPI dock notifier
    chain that has no more users.

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     
  • Since commit 94add0f (ACPI / dock: Initialize ACPI dock subsystem
    upfront) the ACPI dock driver cannot be a module, so
    CONFIG_ACPI_DOCK_MODULE is never set. For this reason, simplify
    the preprocessor conditional in include/acpi/acpi_drivers.h
    referring to that sybbol unnecessarily.

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     
  • There are no users of the ACPI bus notifier call chain,
    acpi_bus_notify_list, any more, so drop it.

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     
  • Functions acpi_dock_match() and acpi_bay_match() in scan.c can be
    shared with dock.c to reduce code duplication, so export them as
    global functions.

    Also add a new function acpi_ata_match() to check whether an ACPI
    device object represents an ATA device.

    [rjw: Changelog]
    Signed-off-by: Jiang Liu
    Signed-off-by: Rafael J. Wysocki

    Jiang Liu
     
  • Introduce two helper functions, acpi_evaluate_ej0() and
    acpi_evaluate_lck(), that will execute the _EJ0 and _LCK ACPI
    control methods, respectively, and use them to simplify the
    ACPI scan code.

    [rjw: Changelog]
    Signed-off-by: Jiang Liu
    Signed-off-by: Rafael J. Wysocki

    Jiang Liu
     
  • Introduce helper function acpi_execute_simple_method() and use it in
    a number of places to simplify code.

    [rjw: Changelog]
    Signed-off-by: Jiang Liu
    Signed-off-by: Rafael J. Wysocki

    Jiang Liu
     
  • Introduce helper function acpi_has_method() and use it in a number
    of places to simplify code.

    [rjw: Changelog]
    Signed-off-by: Jiang Liu
    Signed-off-by: Rafael J. Wysocki

    Jiang Liu
     

04 Jul, 2013

1 commit

  • Pull PCI changes from Bjorn Helgaas:
    "PCI device hotplug
    - Add pci_alloc_dev() interface (Gu Zheng)
    - Add pci_bus_get()/put() for reference counting (Jiang Liu)
    - Fix SR-IOV reference count issues (Jiang Liu)
    - Remove unused acpi_pci_roots list (Jiang Liu)

    MSI
    - Conserve interrupt resources on x86 (Alexander Gordeev)

    AER
    - Force fatal severity when component has been reset (Betty Dall)
    - Reset link below Root Port as well as Downstream Port (Betty Dall)
    - Fix "Firmware first" flag setting (Bjorn Helgaas)
    - Don't parse HEST for non-PCIe devices (Bjorn Helgaas)

    ASPM
    - Warn when we can't disable ASPM as driver requests (Bjorn Helgaas)

    Miscellaneous
    - Add CircuitCo PCI IDs (Darren Hart)
    - Add AMD CZ SATA and SMBus PCI IDs (Shane Huang)
    - Work around Ivytown NTB BAR size issue (Jon Mason)
    - Detect invalid initial BAR values (Kevin Hao)
    - Add pcibios_release_device() (Sebastian Ott)
    - Fix powerpc & sparc PCI_UNKNOWN power state usage (Bjorn Helgaas)"

    * tag 'pci-v3.11-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: (51 commits)
    MAINTAINERS: Add ACPI folks for ACPI-related things under drivers/pci
    PCI: Add CircuitCo vendor ID and subsystem ID
    PCI: Use pdev->pm_cap instead of pci_find_capability(..,PCI_CAP_ID_PM)
    PCI: Return early on allocation failures to unindent mainline code
    PCI: Simplify IOV implementation and fix reference count races
    PCI: Drop redundant setting of bus->is_added in virtfn_add_bus()
    unicore32/PCI: Remove redundant call of pci_bus_add_devices()
    m68k/PCI: Remove redundant call of pci_bus_add_devices()
    PCI / ACPI / PM: Use correct power state strings in messages
    PCI: Fix comment typo for pcie_pme_remove()
    PCI: Rename pci_release_bus_bridge_dev() to pci_release_host_bridge_dev()
    PCI: Fix refcount issue in pci_create_root_bus() error recovery path
    ia64/PCI: Clean up pci_scan_root_bus() usage
    PCI/AER: Reset link for devices below Root Port or Downstream Port
    ACPI / APEI: Force fatal AER severity when component has been reset
    PCI/AER: Remove "extern" from function declarations
    PCI/AER: Move AER severity defines to aer.h
    PCI/AER: Set dev->__aer_firmware_first only for matching devices
    PCI/AER: Factor out HEST device type matching
    PCI/AER: Don't parse HEST table for non-PCIe devices
    ...

    Linus Torvalds
     

28 Jun, 2013

4 commits

  • * acpi-assorted:
    ACPI / EC: Add HP Folio 13 to ec_dmi_table in order to skip DSDT scan
    ACPI: Add CMOS RTC Operation Region handler support
    ACPI: Remove unused flags in acpi_device_flags
    ACPI: Remove useless initializers
    ACPI / battery: Make sure all spaces are in correct places
    ACPI: add _STA evaluation at do_acpi_find_child()
    ACPI / EC: access user space with get_user()/put_user()

    Rafael J. Wysocki
     
  • * acpi-pm:
    ACPI / PM: Rework and clean up acpi_dev_pm_get_state()
    ACPI / PM: Replace ACPI_STATE_D3 with ACPI_STATE_D3_COLD in device_pm.c
    ACPI / PM: Rename function acpi_device_power_state() and make it static
    ACPI / PM: acpi_processor_suspend() can be static
    xen / ACPI / sleep: Register an acpi_suspend_lowlevel callback.
    x86 / ACPI / sleep: Provide registration for acpi_suspend_lowlevel.

    Rafael J. Wysocki
     
  • * acpica: (21 commits)
    ACPICA: Update version to 20130517
    ACPICA: _CST repair: Handle null package entries
    ACPICA: Add several repairs for _CST predefined name
    ACPICA: Move _PRT repair into the standard complex repair module
    ACPICA: Clear events initialized flag upon event component termination
    ACPICA: Fix possible memory leak in GPE init error path
    ACPICA: ACPICA Termination: Delete global lock pending lock
    ACPICA: Update interface to acpi_ut_valid_acpi_name()
    ACPICA: Do not use extended sleep registers unless HW-reduced bit is set
    ACPICA: Split table print utilities to a new a separate file
    ACPICA: Add option to disable loading of SSDTs from the RSDT/XSDT
    ACPICA: Standardize all switch() blocks
    ACPICA: Split internal error msg routines to a separate file
    ACPICA: Split buffer dump routines into separate file
    ACPICA: Update version to 20130418
    ACPICA: Update for "orphan" embedded controller _REG method support
    ACPICA: Remove unused macros, no functional change
    ACPICA: Predefined name support: Remove unused local variable
    ACPICA: Add argument typechecking for all predefined ACPI names
    ACPICA: Add BIOS error interface for predefined name validation support
    ...

    Rafael J. Wysocki
     
  • * acpi-hotplug:
    ACPI: Do not use CONFIG_ACPI_HOTPLUG_MEMORY_MODULE
    ACPI / cpufreq: Add ACPI processor device IDs to acpi-cpufreq
    Memory hotplug: Move alternative function definitions to header
    ACPI / processor: Fix potential NULL pointer dereference in acpi_processor_add()
    Memory hotplug / ACPI: Simplify memory removal
    ACPI / scan: Add second pass of companion offlining to hot-remove code
    Driver core / MM: Drop offline_memory_block()
    ACPI / processor: Pass processor object handle to acpi_bind_one()
    ACPI: Drop removal_type field from struct acpi_device
    Driver core / memory: Simplify __memory_block_change_state()
    ACPI / processor: Initialize per_cpu(processors, pr->id) properly
    CPU: Fix sysfs cpu/online of offlined CPUs
    Driver core: Introduce offline/online callbacks for memory blocks
    ACPI / memhotplug: Bind removable memory blocks to ACPI device nodes
    ACPI / processor: Use common hotplug infrastructure
    ACPI / hotplug: Use device offline/online for graceful hot-removal
    Driver core: Use generic offline/online for CPU offline/online
    Driver core: Add offline/online device operations

    Rafael J. Wysocki
     

24 Jun, 2013

1 commit

  • The interactions between the ACPI dock driver and the ACPI-based PCI
    hotplug (acpiphp) are currently problematic because of ordering
    issues during hot-remove operations.

    First of all, the current ACPI glue code expects that physical
    devices will always be deleted before deleting the companion ACPI
    device objects. Otherwise, acpi_unbind_one() will fail with a
    warning message printed to the kernel log, for example:

    [ 185.026073] usb usb5: Oops, 'acpi_handle' corrupt
    [ 185.035150] pci 0000:1b:00.0: Oops, 'acpi_handle' corrupt
    [ 185.035515] pci 0000:18:02.0: Oops, 'acpi_handle' corrupt
    [ 180.013656] port1: Oops, 'acpi_handle' corrupt

    This means, in particular, that struct pci_dev objects have to
    be deleted before the struct acpi_device objects they are "glued"
    with.

    Now, the following happens the during the undocking of an ACPI-based
    dock station:
    1) hotplug_dock_devices() invokes registered hotplug callbacks to
    destroy physical devices associated with the ACPI device objects
    depending on the dock station. It calls dd->ops->handler() for
    each of those device objects.
    2) For PCI devices dd->ops->handler() points to
    handle_hotplug_event_func() that queues up a separate work item
    to execute _handle_hotplug_event_func() for the given device and
    returns immediately. That work item will be executed later.
    3) hotplug_dock_devices() calls dock_remove_acpi_device() for each
    device depending on the dock station. This runs acpi_bus_trim()
    for each of them, which causes the underlying ACPI device object
    to be destroyed, but the work items queued up by
    handle_hotplug_event_func() haven't been started yet.
    4) _handle_hotplug_event_func() queued up in step 2) are executed
    and cause the above failure to happen, because the PCI devices
    they handle do not have the companion ACPI device objects any
    more (those objects have been deleted in step 3).

    The possible breakage doesn't end here, though, because
    hotplug_dock_devices() may return before at least some of the
    _handle_hotplug_event_func() work items spawned by it have a
    chance to complete and then undock() will cause _DCK to be
    evaluated and that will cause the devices handled by the
    _handle_hotplug_event_func() to go away possibly while they are
    being accessed.

    This means that dd->ops->handler() for PCI devices should not point
    to handle_hotplug_event_func(). Instead, it should point to a
    function that will do the work of _handle_hotplug_event_func()
    synchronously. For this reason, introduce such a function,
    hotplug_event_func(), and modity acpiphp_dock_ops to point to
    it as the handler.

    Unfortunately, however, this is not sufficient, because if the dock
    code were not changed further, hotplug_event_func() would now
    deadlock with hotplug_dock_devices() that called it, since it would
    run unregister_hotplug_dock_device() which in turn would attempt to
    acquire the dock station's hp_lock mutex already acquired by
    hotplug_dock_devices().

    To resolve that deadlock use the observation that
    unregister_hotplug_dock_device() won't need to acquire hp_lock
    if PCI bridges the devices on the dock station depend on are
    prevented from being removed prematurely while the first loop in
    hotplug_dock_devices() is in progress.

    To make that possible, introduce a mechanism by which the callers of
    register_hotplug_dock_device() can provide "init" and "release"
    routines that will be executed, respectively, during the addition
    and removal of the physical device object associated with the
    given ACPI device handle. Make acpiphp use two new functions,
    acpiphp_dock_init() and acpiphp_dock_release(), that call
    get_bridge() and put_bridge(), respectively, on the acpiphp bridge
    holding the given device, for this purpose.

    In addition to that, remove the dock station's list of
    "hotplug devices" and make the dock code always walk the whole list
    of "dependent devices" instead in such a way that the loops in
    hotplug_dock_devices() and dock_event() (replacing the loops over
    "hotplug devices") will take references to the list entries that
    register_hotplug_dock_device() has been called for. That prevents
    the "release" routines associated with those entries from being
    called while the given entry is being processed and for PCI
    devices this means that their bridges won't be removed (by a
    concurrent thread) while hotplug_event_func() handling them is
    being executed.

    This change is based on two earlier patches from Jiang Liu.

    References: https://bugzilla.kernel.org/show_bug.cgi?id=59501
    Reported-and-tested-by: Alexander E. Patrakov
    Tracked-down-by: Jiang Liu
    Tested-by: Illya Klymov
    Signed-off-by: Rafael J. Wysocki
    Acked-by: Yinghai Lu
    Cc: 3.9+

    Rafael J. Wysocki
     

20 Jun, 2013

4 commits

  • Version 20130517.

    Signed-off-by: Bob Moore
    Signed-off-by: Lv Zheng
    Acked-by: Len Brown
    Signed-off-by: Rafael J. Wysocki

    Bob Moore
     
  • Commit 7cd8407 (ACPI / PM: Do not execute _PS0 for devices without
    _PSC during initialization) introduced a regression on some systems
    with Intel Lynxpoint Low-Power Subsystem (LPSS) where some devices
    need to be powered up during initialization, but their device objects
    in the ACPI namespace have _PS0 and _PS3 only (without _PSC or power
    resources).

    To work around this problem, make the ACPI LPSS driver power up
    devices it knows about by using a new helper function
    acpi_device_fix_up_power() that does all of the necessary
    sanity checks and calls acpi_dev_pm_explicit_set() to put the
    device into D0.

    Reported-and-tested-by: Mika Westerberg
    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     
  • There is a name clash between function acpi_device_power_state()
    defined in drivers/acpi/device_pm.c and structure type
    acpi_device_power_state defined in include/acpi/acpi_bus.h, which
    may be resolved by renaming the function. Additionally, that
    funtion may be made static, because it is not used anywhere outside
    of the file it is defined in.

    Rename acpi_device_power_state() to acpi_dev_pm_get_state(), which
    better reflects its purpose, and make it static.

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     
  • suprise_removal_ok and performance_manageable in struct
    acpi_device_flags are not used by any code. So, remove
    them.

    Signed-off-by: Toshi Kani
    Signed-off-by: Rafael J. Wysocki

    Toshi Kani
     

16 Jun, 2013

1 commit

  • Optionally do not load any SSDTs from the RSDT/XSDT during
    initialization. This can be useful for overriding SSDTs
    using DSDT overriding, thus useful for debugging ACPI
    problems on some machines. Lv Zheng. ACPICA BZ 1005.

    References: https://bugs.acpica.org/show_bug.cgi?id=1005
    Signed-off-by: Lv Zheng
    Signed-off-by: Bob Moore
    Signed-off-by: Rafael J. Wysocki

    Lv Zheng