aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiang Liu <liuj97@gmail.com>2013-04-12 01:44:21 -0400
committerBjorn Helgaas <bhelgaas@google.com>2013-04-12 17:38:25 -0400
commit5090d4a6a1f150ec593ac5f2a755b5a3e878b21e (patch)
treeb39f836c2683336289e80a503d947528616d658e
parent10a9574756201fbbdd0cac11f370f00d3d02bfa1 (diff)
PCI/ACPI: Prepare stub functions to handle ACPI PCI (hotplug) slots
Prepare two stub functions to handle ACPI PCI slots and ACPI PCI hotplug slots, which will be invoked by the PCI core when creating/destroying PCI buses. It will be used to get rid of ACPI PCI subdrivers for pci_slot and acpiphp, and eventually remove the ACPI PCI subdriver mechanism. And it will also be used to handle ACPI PCI (hotplug) slots in a unified way, both at boot time and for PCI hotplug operations. Signed-off-by: Jiang Liu <jiang.liu@huawei.com> Signed-off-by: Yijing Wang <wangyijing@huawei.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Reviewed-by: Yinghai Lu <yinghai@kernel.org> Cc: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com> Cc: Toshi Kani <toshi.kani@hp.com> Cc: Tony Luck <tony.luck@intel.com> Cc: Fenghua Yu <fenghua.yu@intel.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Ingo Molnar <mingo@redhat.com> Cc: "H. Peter Anvin" <hpa@zytor.com> Cc: Myron Stowe <myron.stowe@redhat.com>
-rw-r--r--drivers/pci/pci-acpi.c24
-rw-r--r--include/linux/pci-acpi.h8
2 files changed, 31 insertions, 1 deletions
diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c
index dee5dddaa292..b8b8437c703e 100644
--- a/drivers/pci/pci-acpi.c
+++ b/drivers/pci/pci-acpi.c
@@ -287,6 +287,30 @@ static struct pci_platform_pm_ops acpi_pci_platform_pm = {
287 .run_wake = acpi_pci_run_wake, 287 .run_wake = acpi_pci_run_wake,
288}; 288};
289 289
290void acpi_pci_add_bus(struct pci_bus *bus)
291{
292 acpi_handle handle = NULL;
293
294 if (bus->bridge)
295 handle = ACPI_HANDLE(bus->bridge);
296 if (acpi_pci_disabled || handle == NULL)
297 return;
298
299 /* TODO: add PCI slots and acpiphp hotplug slots */
300}
301
302void acpi_pci_remove_bus(struct pci_bus *bus)
303{
304 /*
305 * bus->bridge->acpi_node.handle has already been reset to NULL
306 * when acpi_pci_remove_bus() is called, so don't check ACPI handle.
307 */
308 if (acpi_pci_disabled)
309 return;
310
311 /* TODO: remove PCI slots and acpiphp hotplug slots */
312}
313
290/* ACPI bus type */ 314/* ACPI bus type */
291static int acpi_pci_find_device(struct device *dev, acpi_handle *handle) 315static int acpi_pci_find_device(struct device *dev, acpi_handle *handle)
292{ 316{
diff --git a/include/linux/pci-acpi.h b/include/linux/pci-acpi.h
index 9a22b5efb384..2b1743cc3186 100644
--- a/include/linux/pci-acpi.h
+++ b/include/linux/pci-acpi.h
@@ -41,7 +41,13 @@ static inline acpi_handle acpi_pci_get_bridge_handle(struct pci_bus *pbus)
41 41
42 return DEVICE_ACPI_HANDLE(dev); 42 return DEVICE_ACPI_HANDLE(dev);
43} 43}
44#endif 44
45void acpi_pci_add_bus(struct pci_bus *bus);
46void acpi_pci_remove_bus(struct pci_bus *bus);
47#else /* CONFIG_ACPI */
48static inline void acpi_pci_add_bus(struct pci_bus *bus) { }
49static inline void acpi_pci_remove_bus(struct pci_bus *bus) { }
50#endif /* CONFIG_ACPI */
45 51
46#ifdef CONFIG_ACPI_APEI 52#ifdef CONFIG_ACPI_APEI
47extern bool aer_acpi_firmware_first(void); 53extern bool aer_acpi_firmware_first(void);