Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] acpiphp: Scan slots under the nested P2P bridge

Current ACPIPHP driver scans only slots under the top level PCI-to-PCI
bridge. So hotplug PCI slots under the nested PCI-to-PCI bridge would
not be detected. For example, if the system has the ACPI namespace
like below, hotplug slots woule not be detected.

Device (PCI0) { /* Root bridge */
Name (_HID, "PNP0A03")
Device (P2PA) { /* PCI-to-PCI bridge */
Name (_ADR, ...)
Device (P2PB) { /* PCI-to-PCI bridge */
Name (_ADR, ...)
Device (S0F0) { /* hotplug slot */
Name (_ADR, ...)
Name (_SUN, ...)
Method (_EJ0, ...) { ... }
}
...
Device (S0F7) { /* hotplug slot */
Name (_ADR, ...)
Name (_SUN, ...)
Method (_EJ0, ...) { ... }
}
Device (S1F0) { /* hotplug slot */
Name (_ADR, ...)
Name (_SUN, ...)
Method (_EJ0, ...) { ... }
}
...
}
}
}

This patch fixes this issue.

Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

authored by

Kenji Kaneshige and committed by
Greg Kroah-Hartman
7c8f25da 8e77af6a

+8 -1
+8 -1
drivers/pci/hotplug/acpiphp_glue.c
··· 463 463 add_p2p_bridge(handle, dev); 464 464 } 465 465 466 + /* search P2P bridges under this p2p bridge */ 467 + status = acpi_walk_namespace(ACPI_TYPE_DEVICE, handle, (u32)1, 468 + find_p2p_bridge, dev->subordinate, NULL); 469 + if (ACPI_FAILURE(status)) 470 + warn("find_p2p_bridge faied (error code = 0x%x)\n", status); 471 + 466 472 out: 467 473 pci_dev_put(dev); 468 474 return AE_OK; ··· 609 603 } else { 610 604 /* clean-up p2p bridges under this host bridge */ 611 605 acpi_walk_namespace(ACPI_TYPE_DEVICE, handle, 612 - (u32)1, cleanup_p2p_bridge, NULL, NULL); 606 + ACPI_UINT32_MAX, cleanup_p2p_bridge, 607 + NULL, NULL); 613 608 } 614 609 } 615 610