From 3b63aaa70e1ccc4b66d60acc78da09700706a703 Mon Sep 17 00:00:00 2001 From: Jiang Liu Date: Fri, 12 Apr 2013 05:44:26 +0000 Subject: PCI: acpiphp: Do not use ACPI PCI subdriver mechanism Previously the acpiphp driver registered itself as an ACPI PCI subdriver, so its callbacks were invoked when creating/destroying PCI root buses to manage ACPI-based PCI hotplug slots. But it doesn't handle P2P bridge hotplug events, so it will cause strange behaviour if there are hotplug slots associated with a hot-removed P2P bridge. This patch fixes this issue by: 1) Directly hooking into PCI core to update hotplug slot devices when creating/destroying PCI buses through: pci_{add|remove}_bus() -> acpi_pci_{add|remove}_bus() 2) Getting rid of unused ACPI PCI subdriver-related code It also cleans up unused code in the acpiphp driver. [bhelgaas: keep acpi_pci_add_bus() stub for CONFIG_ACPI=n] Signed-off-by: Jiang Liu Signed-off-by: Yijing Wang Signed-off-by: Bjorn Helgaas Reviewed-by: Yinghai Lu Cc: "Rafael J. Wysocki" Cc: Toshi Kani --- drivers/pci/pci-acpi.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'drivers/pci/pci-acpi.c') diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c index 98e582a2c909..d927933dcf44 100644 --- a/drivers/pci/pci-acpi.c +++ b/drivers/pci/pci-acpi.c @@ -297,6 +297,7 @@ void acpi_pci_add_bus(struct pci_bus *bus) return; acpi_pci_slot_enumerate(bus, handle); + acpiphp_enumerate_slots(bus, handle); } void acpi_pci_remove_bus(struct pci_bus *bus) @@ -308,6 +309,7 @@ void acpi_pci_remove_bus(struct pci_bus *bus) if (acpi_pci_disabled) return; + acpiphp_remove_slots(bus); acpi_pci_slot_remove(bus); } @@ -388,6 +390,7 @@ static int __init acpi_pci_init(void) pci_set_platform_pm(&acpi_pci_platform_pm); acpi_pci_slot_init(); + acpiphp_init(); return 0; } -- cgit v1.2.3