ACPI / PM: Hold acpi_scan_lock over system PM transitions
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 19 Aug 2013 23:42:32 +0000 (01:42 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 20 Aug 2013 23:23:53 +0000 (01:23 +0200)
commitad07277e82dedabacc52c82746633680a3187d25
treefe2d921753be6d8cf4ed9e68b9ad8925212b17ea
parent1aaac07112f04068d7e2fc47bb435cfd4f9d5468
ACPI / PM: Hold acpi_scan_lock over system PM transitions

Bad things happen if ACPI hotplug events are handled during system
PM transitions, especially if devices are removed as a result.
To prevent those bad things from happening, acquire acpi_scan_lock
when a PM transition is started and release it when that transition
is complete or has been aborted.

This fixes resume lockup on my test-bed Acer Aspire S5 that happens
when Thunderbolt devices are disconnected from the machine while
suspended.

Also fixes the analogous problem for Mika Westerberg on an
Intel DZ77RE-75K board.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Tested-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Acked-by: Toshi Kani <toshi.kani@hp.com>
drivers/acpi/sleep.c