Commit ca499fc87ed945094d952da0eb7eea7dbeb1feec

Authored by Toshi Kani
Committed by Rafael J. Wysocki
1 parent 296e5809ee

ACPI / hotplug: Fix conflicted PCI bridge notify handlers

The PCI host bridge scan handler installs its own notify handler,
handle_hotplug_event_root(), by itself.  Nevertheless, the ACPI
hotplug framework also installs the common notify handler,
acpi_hotplug_notify_cb(), for PCI root bridges.  This causes
acpi_hotplug_notify_cb() to call _OST method with unsupported
error as hotplug.enabled is not set.

To address this issue, introduce hotplug.ignore flag, which
indicates that the scan handler installs its own notify handler by
itself.  The ACPI hotplug framework does not install the common
notify handler when this flag is set.

Signed-off-by: Toshi Kani <toshi.kani@hp.com>
[rjw: Changed the name of the new flag]
Cc: 3.9+ <stable@vger.kernel.org> # 3.9+
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

Showing 3 changed files with 5 additions and 1 deletions Side-by-side Diff

drivers/acpi/pci_root.c
... ... @@ -65,6 +65,9 @@
65 65 .ids = root_device_ids,
66 66 .attach = acpi_pci_root_add,
67 67 .detach = acpi_pci_root_remove,
  68 + .hotplug = {
  69 + .ignore = true,
  70 + },
68 71 };
69 72  
70 73 static DEFINE_MUTEX(osc_lock);
... ... @@ -1773,7 +1773,7 @@
1773 1773 */
1774 1774 list_for_each_entry(hwid, &pnp.ids, list) {
1775 1775 handler = acpi_scan_match_handler(hwid->id, NULL);
1776   - if (handler) {
  1776 + if (handler && !handler->hotplug.ignore) {
1777 1777 acpi_install_notify_handler(handle, ACPI_SYSTEM_NOTIFY,
1778 1778 acpi_hotplug_notify_cb, handler);
1779 1779 break;
include/acpi/acpi_bus.h
... ... @@ -100,6 +100,7 @@
100 100 struct acpi_hotplug_profile {
101 101 struct kobject kobj;
102 102 bool enabled:1;
  103 + bool ignore:1;
103 104 enum acpi_hotplug_mode mode;
104 105 };
105 106