From: tcamuso@redhat.com <tcamuso@redhat.com> Date: Mon, 7 Jan 2008 22:15:46 -0500 Subject: [x86] mmconfig: call pcibios_fix_bus_scan Message-id: 20080108031546.15008.24045.sendpatchset@dhcp83-188.boston.redhat.com O-Subject: [PATCH 6/6][Version-2]PCI: x86 MMCONFIG: call pcibios_fix_bus_scan() Bugzilla: 408551 diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 6f164fa..619f622 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -753,6 +753,15 @@ void pcim_pin_device(struct pci_dev *pdev) } /** + * pcibios_fix_bus_scan_quirk - provide for arch-specific bus scan quirks + * @bus: the PCI bus to scan + * + * Scans the bus for arch-specific quirks. This is the default implementation. + * Architecture implementations can override this. + */ +void __attribute__ ((weak)) pcibios_fix_bus_scan_quirk(struct pci_bus *bus) {} + +/** * pcibios_disable_device - disable arch specific PCI resources for device dev * @dev: the PCI device to disable * diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h index 9550591..24202dd 100644 --- a/drivers/pci/pci.h +++ b/drivers/pci/pci.h @@ -73,6 +73,7 @@ static inline int pci_no_d1d2(struct pci_dev *dev) extern int pcie_mch_quirk; extern struct device_attribute pci_dev_attrs[]; extern struct class_device_attribute class_device_attr_cpuaffinity; +extern void pcibios_fix_bus_scan_quirk(struct pci_bus *bus); /** * pci_match_one_device - Tell if a PCI device structure has a matching diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index 79cd2f8..4830cb1 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -2,13 +2,13 @@ * probe.c - PCI detection and setup code */ -#include <linux/kernel.h> +#include <linux/cpumask.h> #include <linux/delay.h> #include <linux/init.h> +#include <linux/kernel.h> +#include <linux/module.h> #include <linux/pci.h> #include <linux/slab.h> -#include <linux/module.h> -#include <linux/cpumask.h> #include "pci.h" #define CARDBUS_LATENCY_TIMER 176 /* secondary latency timer */ @@ -923,6 +923,11 @@ unsigned int __devinit pci_scan_child_bus(struct pci_bus *bus) unsigned int devfn, pass, max = bus->secondary; struct pci_dev *dev; + /* + * Address arch-dependent bus scanning quirks before scanning the bus. + */ + pcibios_fix_bus_scan_quirk(bus); + pr_debug("PCI: Scanning bus %04x:%02x\n", pci_domain_nr(bus), bus->number); /* Go find them, Rover! */