1. 19 11月, 2013 4 次提交
  2. 08 11月, 2013 1 次提交
    • R
      ACPI / hotplug: Consolidate deferred execution of ACPI hotplug routines · 7b98118a
      Rafael J. Wysocki 提交于
      There are two different interfaces for queuing up work items on the
      ACPI hotplug workqueue, alloc_acpi_hp_work() used by PCI and PCI host
      bridge hotplug code and acpi_os_hotplug_execute() used by the common
      ACPI hotplug code and docking stations.  They both are somewhat
      cumbersome to use and work slightly differently.
      
      The users of alloc_acpi_hp_work() have to submit a work function that
      will extract the necessary data items from a struct acpi_hp_work
      object allocated by alloc_acpi_hp_work() and then will free that
      object, while it would be more straightforward to simply use a work
      function with one more argument and let the interface take care of
      the execution details.
      
      The users of acpi_os_hotplug_execute() also have to deal with the
      fact that it takes only one argument in addition to the work function
      pointer, although acpi_os_execute_deferred() actually takes care of
      the allocation and freeing of memory, so it would have been able to
      pass more arguments to the work function if it hadn't been
      constrained by the connection with acpi_os_execute().
      
      Moreover, while alloc_acpi_hp_work() makes GFP_KERNEL memory
      allocations, which is correct, because hotplug work items are
      always queued up from process context, acpi_os_hotplug_execute()
      uses GFP_ATOMIC, as that is needed by acpi_os_execute().  Also,
      acpi_os_execute_deferred() queued up by it waits for the ACPI event
      workqueues to flush before executing the work function, whereas
      alloc_acpi_hp_work() can't do anything similar.  That leads to
      somewhat arbitrary differences in behavior between various ACPI
      hotplug code paths and has to be straightened up.
      
      For this reason, replace both alloc_acpi_hp_work() and
      acpi_os_hotplug_execute() with a single interface,
      acpi_hotplug_execute(), combining their behavior and being more
      friendly to its users than any of the two.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Tested-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      7b98118a
  3. 07 11月, 2013 9 次提交
  4. 10 10月, 2013 1 次提交
  5. 01 10月, 2013 3 次提交
  6. 10 9月, 2013 1 次提交
  7. 06 9月, 2013 1 次提交
  8. 02 9月, 2013 1 次提交
  9. 31 8月, 2013 1 次提交
  10. 30 8月, 2013 2 次提交
    • N
      PCI/ACPI: Fix _OSC ordering to allow PCIe hotplug use when available · 3dc48af3
      Neil Horman 提交于
      This fixes the problem of acpiphp claiming slots that should be managed
      by pciehp, which may keep ExpressCard slots from working.
      
      The acpiphp driver claims PCIe slots unless the BIOS has granted us
      control of PCIe native hotplug via _OSC.  Prior to v3.10, the acpiphp
      .add method (add_bridge()) was always called *after* we had requested
      native hotplug control with _OSC.
      
      But after 3b63aaa7 ("PCI: acpiphp: Do not use ACPI PCI subdriver
      mechanism"), which appeared in v3.10, acpiphp initialization is done
      during the bus scan via the pcibios_add_bus() hook, and this happens
      *before* we request native hotplug control.
      
      Therefore, acpiphp doesn't know yet whether the BIOS will grant control,
      and it claims slots that we should be handling with native hotplug.
      
      This patch requests native hotplug control earlier, so we know whether
      the BIOS granted it to us before we initialize acpiphp.
      
      To avoid reintroducing the ASPM issue fixed by b8178f13 ('Revert
      "PCI/ACPI: Request _OSC control before scanning PCI root bus"'), we run
      _OSC earlier but defer the actual ASPM calls until after the bus scan is
      complete.
      
      Tested successfully by myself.
      
      [bhelgaas: changelog, mark for stable]
      Reference: https://bugzilla.kernel.org/show_bug.cgi?id=60736Signed-off-by: NNeil Horman <nhorman@tuxdriver.com>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      Acked-by: NYinghai Lu <yinghai@kernel.org>
      CC: stable@vger.kernel.org	# v3.10+
      CC: Len Brown <lenb@kernel.org>
      CC: "Rafael J. Wysocki" <rjw@sisk.pl>
      3dc48af3
    • R
      ACPI / hotplug: Remove containers synchronously · f943db40
      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: NGu Zheng <guz.fnst@cn.fujitsu.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Acked-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Acked-by: NToshi Kani <toshi.kani@hp.com>
      f943db40
  11. 29 8月, 2013 2 次提交
  12. 26 8月, 2013 1 次提交
  13. 23 8月, 2013 2 次提交
  14. 22 8月, 2013 2 次提交
  15. 21 8月, 2013 1 次提交
  16. 20 8月, 2013 4 次提交
  17. 15 8月, 2013 4 次提交