]> git.baikalelectronics.ru Git - kernel.git/commit
ACPI / scan: Make acpi_bus_hot_remove_device() acquire the scan lock
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Sat, 9 Feb 2013 14:29:11 +0000 (15:29 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 13 Feb 2013 12:46:31 +0000 (13:46 +0100)
commit5f9721c6e6b91bd2ae2c0f731719159d38eb327d
treeb67dcec5a9e7d0d4e6cd65033c8f5fb19616e5e2
parent6dbfbdd1b38d12081ba21906bce77a9c1a40c22f
ACPI / scan: Make acpi_bus_hot_remove_device() acquire the scan lock

The ACPI scan lock has been introduced to prevent acpi_bus_scan()
and acpi_bus_trim() from running in parallel with each other for
overlapping ACPI namespace scopes.  However, it is not sufficient
to do that, because if acpi_bus_scan() is run (for an overlapping
namespace scope) right after the acpi_bus_trim() in
acpi_bus_hot_remove_device(), the subsequent eject will remove
devices without removing the corresponding struct acpi_device
objects (and possibly companion "physical" device objects).
Therefore acpi_bus_hot_remove_device() has to acquire the scan
lock before carrying out the bus trimming and hold it through
the evaluation of _EJ0, so make that happen.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Toshi Kani <toshi.kani@hp.com>
drivers/acpi/scan.c