aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/hotplug
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2006-08-31 01:45:48 -0400
committerPaul Mackerras <paulus@samba.org>2006-08-31 01:45:48 -0400
commitaa43f77939c97bf9d3580c6a5e71a5a40290e451 (patch)
tree095c0b8b3da4b6554a3f8ef4b39240a5d9216d4d /drivers/pci/hotplug
parent2818c5dec5e28d65d52afbb7695bbbafe6377ee5 (diff)
parent4c15343167b5febe7bb0ba96aad5bef42ae94d3b (diff)
Merge branch 'merge'
Diffstat (limited to 'drivers/pci/hotplug')
-rw-r--r--drivers/pci/hotplug/Kconfig9
-rw-r--r--drivers/pci/hotplug/cpci_hotplug_pci.c54
-rw-r--r--drivers/pci/hotplug/pciehp.h5
-rw-r--r--drivers/pci/hotplug/pciehp_hpc.c4
4 files changed, 48 insertions, 24 deletions
diff --git a/drivers/pci/hotplug/Kconfig b/drivers/pci/hotplug/Kconfig
index 3fae77ffb2fa..8a60f391ffcf 100644
--- a/drivers/pci/hotplug/Kconfig
+++ b/drivers/pci/hotplug/Kconfig
@@ -76,7 +76,7 @@ config HOTPLUG_PCI_IBM
76 76
77config HOTPLUG_PCI_ACPI 77config HOTPLUG_PCI_ACPI
78 tristate "ACPI PCI Hotplug driver" 78 tristate "ACPI PCI Hotplug driver"
79 depends on ACPI_DOCK && HOTPLUG_PCI 79 depends on (!ACPI_DOCK && ACPI && HOTPLUG_PCI) || (ACPI_DOCK && HOTPLUG_PCI)
80 help 80 help
81 Say Y here if you have a system that supports PCI Hotplug using 81 Say Y here if you have a system that supports PCI Hotplug using
82 ACPI. 82 ACPI.
@@ -153,13 +153,6 @@ config HOTPLUG_PCI_SHPC_POLL_EVENT_MODE
153 153
154 When in doubt, say N. 154 When in doubt, say N.
155 155
156config HOTPLUG_PCI_SHPC_PHPRM_LEGACY
157 bool "For AMD SHPC only: Use $HRT for resource/configuration"
158 depends on HOTPLUG_PCI_SHPC && !ACPI
159 help
160 Say Y here for AMD SHPC. You have to select this option if you are
161 using this driver on platform with AMD SHPC.
162
163config HOTPLUG_PCI_RPA 156config HOTPLUG_PCI_RPA
164 tristate "RPA PCI Hotplug driver" 157 tristate "RPA PCI Hotplug driver"
165 depends on HOTPLUG_PCI && PPC_PSERIES && PPC64 && !HOTPLUG_PCI_FAKE 158 depends on HOTPLUG_PCI && PPC_PSERIES && PPC64 && !HOTPLUG_PCI_FAKE
diff --git a/drivers/pci/hotplug/cpci_hotplug_pci.c b/drivers/pci/hotplug/cpci_hotplug_pci.c
index 02be74caa89f..4afcaffd031c 100644
--- a/drivers/pci/hotplug/cpci_hotplug_pci.c
+++ b/drivers/pci/hotplug/cpci_hotplug_pci.c
@@ -254,8 +254,8 @@ int cpci_led_off(struct slot* slot)
254 254
255int cpci_configure_slot(struct slot* slot) 255int cpci_configure_slot(struct slot* slot)
256{ 256{
257 unsigned char busnr; 257 struct pci_bus *parent;
258 struct pci_bus *child; 258 int fn;
259 259
260 dbg("%s - enter", __FUNCTION__); 260 dbg("%s - enter", __FUNCTION__);
261 261
@@ -276,23 +276,53 @@ int cpci_configure_slot(struct slot* slot)
276 */ 276 */
277 n = pci_scan_slot(slot->bus, slot->devfn); 277 n = pci_scan_slot(slot->bus, slot->devfn);
278 dbg("%s: pci_scan_slot returned %d", __FUNCTION__, n); 278 dbg("%s: pci_scan_slot returned %d", __FUNCTION__, n);
279 if (n > 0)
280 pci_bus_add_devices(slot->bus);
281 slot->dev = pci_get_slot(slot->bus, slot->devfn); 279 slot->dev = pci_get_slot(slot->bus, slot->devfn);
282 if (slot->dev == NULL) { 280 if (slot->dev == NULL) {
283 err("Could not find PCI device for slot %02x", slot->number); 281 err("Could not find PCI device for slot %02x", slot->number);
284 return 1; 282 return -ENODEV;
285 } 283 }
286 } 284 }
287 285 parent = slot->dev->bus;
288 if (slot->dev->hdr_type == PCI_HEADER_TYPE_BRIDGE) { 286
289 pci_read_config_byte(slot->dev, PCI_SECONDARY_BUS, &busnr); 287 for (fn = 0; fn < 8; fn++) {
290 child = pci_add_new_bus(slot->dev->bus, slot->dev, busnr); 288 struct pci_dev *dev;
291 pci_do_scan_bus(child); 289
292 pci_bus_size_bridges(child); 290 dev = pci_get_slot(parent, PCI_DEVFN(PCI_SLOT(slot->devfn), fn));
291 if (!dev)
292 continue;
293 if ((dev->hdr_type == PCI_HEADER_TYPE_BRIDGE) ||
294 (dev->hdr_type == PCI_HEADER_TYPE_CARDBUS)) {
295 /* Find an unused bus number for the new bridge */
296 struct pci_bus *child;
297 unsigned char busnr, start = parent->secondary;
298 unsigned char end = parent->subordinate;
299
300 for (busnr = start; busnr <= end; busnr++) {
301 if (!pci_find_bus(pci_domain_nr(parent),
302 busnr))
303 break;
304 }
305 if (busnr >= end) {
306 err("No free bus for hot-added bridge\n");
307 pci_dev_put(dev);
308 continue;
309 }
310 child = pci_add_new_bus(parent, dev, busnr);
311 if (!child) {
312 err("Cannot add new bus for %s\n",
313 pci_name(dev));
314 pci_dev_put(dev);
315 continue;
316 }
317 child->subordinate = pci_do_scan_bus(child);
318 pci_bus_size_bridges(child);
319 }
320 pci_dev_put(dev);
293 } 321 }
294 322
295 pci_bus_assign_resources(slot->dev->bus); 323 pci_bus_assign_resources(parent);
324 pci_bus_add_devices(parent);
325 pci_enable_bridges(parent);
296 326
297 dbg("%s - exit", __FUNCTION__); 327 dbg("%s - exit", __FUNCTION__);
298 return 0; 328 return 0;
diff --git a/drivers/pci/hotplug/pciehp.h b/drivers/pci/hotplug/pciehp.h
index ce89f5815861..eaea9d36a1bb 100644
--- a/drivers/pci/hotplug/pciehp.h
+++ b/drivers/pci/hotplug/pciehp.h
@@ -279,6 +279,11 @@ struct hpc_ops {
279 279
280 280
281#ifdef CONFIG_ACPI 281#ifdef CONFIG_ACPI
282#include <acpi/acpi.h>
283#include <acpi/acpi_bus.h>
284#include <acpi/actypes.h>
285#include <linux/pci-acpi.h>
286
282#define pciehp_get_hp_hw_control_from_firmware(dev) \ 287#define pciehp_get_hp_hw_control_from_firmware(dev) \
283 pciehp_acpi_get_hp_hw_control_from_firmware(dev) 288 pciehp_acpi_get_hp_hw_control_from_firmware(dev)
284static inline int pciehp_get_hp_params_from_firmware(struct pci_dev *dev, 289static inline int pciehp_get_hp_params_from_firmware(struct pci_dev *dev,
diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c
index 0d8fb6e607a1..6ab3b6cd2b54 100644
--- a/drivers/pci/hotplug/pciehp_hpc.c
+++ b/drivers/pci/hotplug/pciehp_hpc.c
@@ -38,10 +38,6 @@
38 38
39#include "../pci.h" 39#include "../pci.h"
40#include "pciehp.h" 40#include "pciehp.h"
41#include <acpi/acpi.h>
42#include <acpi/acpi_bus.h>
43#include <acpi/actypes.h>
44#include <linux/pci-acpi.h>
45#ifdef DEBUG 41#ifdef DEBUG
46#define DBG_K_TRACE_ENTRY ((unsigned int)0x00000001) /* On function entry */ 42#define DBG_K_TRACE_ENTRY ((unsigned int)0x00000001) /* On function entry */
47#define DBG_K_TRACE_EXIT ((unsigned int)0x00000002) /* On function exit */ 43#define DBG_K_TRACE_EXIT ((unsigned int)0x00000002) /* On function exit */