alistair23-linux/include/acpi
Rafael J. Wysocki f943db40c2 ACPI / hotplug: Remove containers synchronously
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 <guz.fnst@cn.fujitsu.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Toshi Kani <toshi.kani@hp.com>
2013-08-29 22:01:16 +02:00
..
platform ACPICA: Update ACPICA copyrights to 2013 2013-01-25 13:30:47 +01:00
acbuffer.h ACPICA: Update ACPICA copyrights to 2013 2013-01-25 13:30:47 +01:00
acconfig.h ACPICA: Add argument typechecking for all predefined ACPI names 2013-06-01 21:54:30 +02:00
acexcep.h ACPICA: Add exception descriptions to exception info table 2013-03-12 00:45:05 +01:00
acnames.h ACPICA: Update ACPICA copyrights to 2013 2013-01-25 13:30:47 +01:00
acoutput.h ACPICA: Remove unused macros, no functional change 2013-06-01 21:54:31 +02:00
acpi.h ACPICA: Update ACPICA copyrights to 2013 2013-01-25 13:30:47 +01:00
acpi_bus.h ACPI / hotplug: Remove containers synchronously 2013-08-29 22:01:16 +02:00
acpi_drivers.h ACPI / dock / PCI: Synchronous handling of dock events for PCI devices 2013-06-24 11:22:53 +02:00
acpi_numa.h ACPI: Store SRAT table revision 2012-01-17 04:19:04 -05:00
acpiosxf.h ACPI: Fix section to __init. Align with usage in acpixf.h 2013-05-12 14:03:14 +02:00
acpixf.h ACPICA: expose OSI version 2013-07-18 01:29:14 +02:00
acrestyp.h ACPICA: Update ACPICA copyrights to 2013 2013-01-25 13:30:47 +01:00
actbl.h ACPICA: Update ACPICA copyrights to 2013 2013-01-25 13:30:47 +01:00
actbl1.h ACPICA: Update ACPICA copyrights to 2013 2013-01-25 13:30:47 +01:00
actbl2.h ACPICA: iASL/Disassembler: Add support for MTMR table 2013-03-12 00:45:04 +01:00
actbl3.h ACPICA: Remove trailing comma in enum declarations 2013-03-12 00:45:05 +01:00
actypes.h ACPICA: expose OSI version 2013-07-18 01:29:14 +02:00
apei.h module_param: make bool parameters really bool (drivers & misc) 2012-01-13 09:32:20 +10:30
button.h
ghes.h ghes: add the needed hooks for EDAC error report 2013-02-25 19:41:51 -03:00
hed.h
pdc_intel.h
processor.h ACPI / processor: Use common hotplug infrastructure 2013-05-12 14:14:32 +02:00
reboot.h
video.h Revert "ACPI / video / i915: No ACPI backlight if firmware expects Windows 8" 2013-07-26 14:59:20 +02:00