]> rtime.felk.cvut.cz Git - linux-imx.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)
commitf058cdf4cf3e5181172455f90fc73f2127b6ddf8
treeb67dcec5a9e7d0d4e6cd65033c8f5fb19616e5e2
parent87d4a4da7353c8582049dab50b880798d88ff9d7
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