Skip to content

Commit 8c4baca

Browse files
Toshi Kanigregkh
Toshi Kani
authored andcommitted
ACPI / hotplug: Fix conflicted PCI bridge notify handlers
commit ca499fc upstream. 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 <[email protected]> [rjw: Changed the name of the new flag] Signed-off-by: Rafael J. Wysocki <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 45364a2 commit 8c4baca

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

drivers/acpi/pci_root.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ static struct acpi_scan_handler pci_root_handler = {
6363
.ids = root_device_ids,
6464
.attach = acpi_pci_root_add,
6565
.detach = acpi_pci_root_remove,
66+
.hotplug = {
67+
.ignore = true,
68+
},
6669
};
6770

6871
static DEFINE_MUTEX(osc_lock);

drivers/acpi/scan.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1812,7 +1812,7 @@ static void acpi_scan_init_hotplug(acpi_handle handle, int type)
18121812
*/
18131813
list_for_each_entry(hwid, &pnp.ids, list) {
18141814
handler = acpi_scan_match_handler(hwid->id, NULL);
1815-
if (handler) {
1815+
if (handler && !handler->hotplug.ignore) {
18161816
acpi_install_notify_handler(handle, ACPI_SYSTEM_NOTIFY,
18171817
acpi_hotplug_notify_cb, handler);
18181818
break;

include/acpi/acpi_bus.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ enum acpi_hotplug_mode {
100100
struct acpi_hotplug_profile {
101101
struct kobject kobj;
102102
bool enabled:1;
103+
bool ignore:1;
103104
enum acpi_hotplug_mode mode;
104105
};
105106

0 commit comments

Comments
 (0)