aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-02-10 07:36:26 -0500
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-02-10 07:36:26 -0500
commit21369c77477a7f937174833c8094154f0f995710 (patch)
treef7919580a770be3dbe3bf388f4237cb4e1b2ecd2
parentb169ba5ae49a810876f3baa5da5283e95c836527 (diff)
ACPI / hotplug / PCI: Execute _EJ0 under the ACPI scan lock
Since acpi_device_hotplug() assumes that ACPI handles of device objects passed to it will not become invalid while acpi_scan_lock is being held, make acpiphp_disable_slot() acquire acpi_scan_lock, because it generally causes _EJ0 to be executed for one of the devices in the slot and that may cause its ACPI handle to become invalid. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r--drivers/pci/hotplug/acpiphp_glue.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c
index 11a6117fb358..fa8fe7441952 100644
--- a/drivers/pci/hotplug/acpiphp_glue.c
+++ b/drivers/pci/hotplug/acpiphp_glue.c
@@ -1007,9 +1007,15 @@ int acpiphp_disable_slot(struct acpiphp_slot *slot)
1007{ 1007{
1008 int ret; 1008 int ret;
1009 1009
1010 /*
1011 * Acquire acpi_scan_lock to ensure that the execution of _EJ0 in
1012 * acpiphp_disable_and_eject_slot() will be synchronized properly.
1013 */
1014 acpi_scan_lock_acquire();
1010 pci_lock_rescan_remove(); 1015 pci_lock_rescan_remove();
1011 ret = acpiphp_disable_and_eject_slot(slot); 1016 ret = acpiphp_disable_and_eject_slot(slot);
1012 pci_unlock_rescan_remove(); 1017 pci_unlock_rescan_remove();
1018 acpi_scan_lock_release();
1013 return ret; 1019 return ret;
1014} 1020}
1015 1021