diff options
| -rw-r--r-- | arch/powerpc/kernel/pci-common.c | 17 | ||||
| -rw-r--r-- | arch/powerpc/platforms/pseries/eeh_cache.c | 4 |
2 files changed, 14 insertions, 7 deletions
diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c index eabeec991016..f46914a0f33e 100644 --- a/arch/powerpc/kernel/pci-common.c +++ b/arch/powerpc/kernel/pci-common.c | |||
| @@ -994,7 +994,7 @@ void pcibios_setup_bus_self(struct pci_bus *bus) | |||
| 994 | ppc_md.pci_dma_bus_setup(bus); | 994 | ppc_md.pci_dma_bus_setup(bus); |
| 995 | } | 995 | } |
| 996 | 996 | ||
| 997 | void pcibios_setup_device(struct pci_dev *dev) | 997 | static void pcibios_setup_device(struct pci_dev *dev) |
| 998 | { | 998 | { |
| 999 | /* Fixup NUMA node as it may not be setup yet by the generic | 999 | /* Fixup NUMA node as it may not be setup yet by the generic |
| 1000 | * code and is needed by the DMA init | 1000 | * code and is needed by the DMA init |
| @@ -1015,6 +1015,17 @@ void pcibios_setup_device(struct pci_dev *dev) | |||
| 1015 | ppc_md.pci_irq_fixup(dev); | 1015 | ppc_md.pci_irq_fixup(dev); |
| 1016 | } | 1016 | } |
| 1017 | 1017 | ||
| 1018 | int pcibios_add_device(struct pci_dev *dev) | ||
| 1019 | { | ||
| 1020 | /* | ||
| 1021 | * We can only call pcibios_setup_device() after bus setup is complete, | ||
| 1022 | * since some of the platform specific DMA setup code depends on it. | ||
| 1023 | */ | ||
| 1024 | if (dev->bus->is_added) | ||
| 1025 | pcibios_setup_device(dev); | ||
| 1026 | return 0; | ||
| 1027 | } | ||
| 1028 | |||
| 1018 | void pcibios_setup_bus_devices(struct pci_bus *bus) | 1029 | void pcibios_setup_bus_devices(struct pci_bus *bus) |
| 1019 | { | 1030 | { |
| 1020 | struct pci_dev *dev; | 1031 | struct pci_dev *dev; |
| @@ -1469,10 +1480,6 @@ int pcibios_enable_device(struct pci_dev *dev, int mask) | |||
| 1469 | if (ppc_md.pcibios_enable_device_hook(dev)) | 1480 | if (ppc_md.pcibios_enable_device_hook(dev)) |
| 1470 | return -EINVAL; | 1481 | return -EINVAL; |
| 1471 | 1482 | ||
| 1472 | /* avoid pcie irq fix up impact on cardbus */ | ||
| 1473 | if (dev->hdr_type != PCI_HEADER_TYPE_CARDBUS) | ||
| 1474 | pcibios_setup_device(dev); | ||
| 1475 | |||
| 1476 | return pci_enable_resources(dev, mask); | 1483 | return pci_enable_resources(dev, mask); |
| 1477 | } | 1484 | } |
| 1478 | 1485 | ||
diff --git a/arch/powerpc/platforms/pseries/eeh_cache.c b/arch/powerpc/platforms/pseries/eeh_cache.c index 5a4c87903057..5ce3ba7ad137 100644 --- a/arch/powerpc/platforms/pseries/eeh_cache.c +++ b/arch/powerpc/platforms/pseries/eeh_cache.c | |||
| @@ -294,8 +294,6 @@ void __init eeh_addr_cache_build(void) | |||
| 294 | spin_lock_init(&pci_io_addr_cache_root.piar_lock); | 294 | spin_lock_init(&pci_io_addr_cache_root.piar_lock); |
| 295 | 295 | ||
| 296 | for_each_pci_dev(dev) { | 296 | for_each_pci_dev(dev) { |
| 297 | eeh_addr_cache_insert_dev(dev); | ||
| 298 | |||
| 299 | dn = pci_device_to_OF_node(dev); | 297 | dn = pci_device_to_OF_node(dev); |
| 300 | if (!dn) | 298 | if (!dn) |
| 301 | continue; | 299 | continue; |
| @@ -308,6 +306,8 @@ void __init eeh_addr_cache_build(void) | |||
| 308 | dev->dev.archdata.edev = edev; | 306 | dev->dev.archdata.edev = edev; |
| 309 | edev->pdev = dev; | 307 | edev->pdev = dev; |
| 310 | 308 | ||
| 309 | eeh_addr_cache_insert_dev(dev); | ||
| 310 | |||
| 311 | eeh_sysfs_add_device(dev); | 311 | eeh_sysfs_add_device(dev); |
| 312 | } | 312 | } |
| 313 | 313 | ||
