I updated Yakui's patch, so it could be applied after x86.git#testing Please check it YH
From : Zhao Yakui <yakui.zhao@xxxxxxxxx> [PATCH] Unneccessary to scan the PCI bus already scanned v2 http://bugzilla.kernel.org/show_bug.cgi?id=10124 commit 08f1c192c3c32797068bfe97738babb3295bbf42 Author: Muli Ben-Yehuda <muli@xxxxxxxxxx> Date: Sun Jul 22 00:23:39 2007 +0300 x86-64: introduce struct pci_sysdata to facilitate sharing of ->sysdata This patch introduces struct pci_sysdata to x86 and x86-64, and converts the existing two users (NUMA, Calgary) to use it. This lays the groundwork for having other users of sysdata, such as the PCI domains work. The Calgary bits are tested, the NUMA bits just look ok. that replace pcibios_scan_root by pci_scan_bus_parented... but in pcibios_scan_root we have check about scanned bus Yinghai make it can be applied after patches in x86.git#tesing Signed-off-by: Zhao Yakui <yakui.zhao@xxxxxxxxx> Signed-off-by: Li Shaohua <shaohua.li@xxxxxxxxx> Signed-off-by: Yinghai Lu <yhlu.kernel@xxxxxxxxx> diff --git a/arch/x86/pci/acpi.c b/arch/x86/pci/acpi.c index 2c1a651..7e2bfe3 100644 --- a/arch/x86/pci/acpi.c +++ b/arch/x86/pci/acpi.c @@ -213,33 +213,38 @@ struct pci_bus * __devinit pci_acpi_scan_root(struct acpi_device *device, int do set_mp_bus_to_node(busnum, node); else node = get_mp_bus_to_node(busnum); - - if (node != -1 && !node_online(node)) - node = -1; #endif - /* Allocate per-root-bus (not per bus) arch-specific data. - * TODO: leak; this memory is never freed. - * It's arguable whether it's worth the trouble to care. - */ - sd = kzalloc(sizeof(*sd), GFP_KERNEL); - if (!sd) { - printk(KERN_ERR "PCI: OOM, not probing PCI bus %02x\n", busnum); - return NULL; - } + bus = pci_find_bus(domain, busnum); + if (bus) { + /* already scanned ?*/ + sd = bus->sysdata; + sd->node = node; + } else { + /* Allocate per-root-bus (not per bus) arch-specific data. + * TODO: leak; this memory is never freed. + * It's arguable whether it's worth the trouble to care. + */ + sd = kzalloc(sizeof(*sd), GFP_KERNEL); + if (!sd) { + printk(KERN_ERR "PCI: OOM, not probing PCI bus %02x\n", + busnum); + return NULL; + } - sd->domain = domain; - sd->node = node; + sd->domain = domain; + sd->node = node; - bus = pci_scan_bus_parented(NULL, busnum, &pci_root_ops, sd); - if (!bus) - kfree(sd); + bus = pci_scan_bus_parented(NULL, busnum, &pci_root_ops, sd); + if (!bus) + kfree(sd); + } #ifdef CONFIG_ACPI_NUMA if (bus) { if (pxm >= 0) { printk(KERN_DEBUG "bus %02x -> pxm %d -> node %d\n", - busnum, pxm, sd->node); + busnum, pxm, node); } } #endif