diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2006-03-15 16:09:21 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-03-15 16:09:21 -0800 |
commit | b145c013148c2b86c6c077a7b8950b6d5e753510 (patch) | |
tree | fc597f10290cb0aecada3a6a378e0a1dbbf9ff50 /bad | |
parent | e5d80d56cbb9674181c3625fc3c9bcdbaa3fd5ec (diff) | |
download | patches-b145c013148c2b86c6c077a7b8950b6d5e753510.tar.gz |
move pci domain patches to bad directory :(
Diffstat (limited to 'bad')
-rw-r--r-- | bad/pci-domain/pci-device-ensure-sysdata-initialised.patch | 167 | ||||
-rw-r--r-- | bad/pci-domain/pci-fix-the-x86-pci-domain-support-fix.patch | 39 | ||||
-rw-r--r-- | bad/pci-domain/series | 6 | ||||
-rw-r--r-- | bad/pci-domain/x86-pci-domain-support-a-humble-fix.patch | 40 | ||||
-rw-r--r-- | bad/pci-domain/x86-pci-domain-support-struct-pci_sysdata.patch | 150 | ||||
-rw-r--r-- | bad/pci-domain/x86-pci-domain-support-the-meat.patch | 116 |
6 files changed, 518 insertions, 0 deletions
diff --git a/bad/pci-domain/pci-device-ensure-sysdata-initialised.patch b/bad/pci-domain/pci-device-ensure-sysdata-initialised.patch new file mode 100644 index 0000000000000..23e54087b7f7c --- /dev/null +++ b/bad/pci-domain/pci-device-ensure-sysdata-initialised.patch @@ -0,0 +1,167 @@ +From akpm@osdl.org Fri Feb 3 01:46:42 2006 +Message-Id: <200602030946.k139kKQj002413@shell0.pdx.osdl.net> +Subject: pci device: ensure sysdata initialised +To: greg@kroah.com +Cc: akpm@osdl.org, apw@shadowen.org, jgarzik@pobox.com, mbligh@aracnet.com +From: akpm@osdl.org +Date: Fri, 03 Feb 2006 01:46:01 -0800 + + +From: Andy Whitcroft <apw@shadowen.org> + +Ensure sysdata is valid for all busses. + +We have been seeing panic's on NUMA systems in pci_call_probe() in +2.6.15-rc5-mm2 and -mm3. It seems that some changes have occured to the +meaning of the 'sysdata' for a device such that it is no longer just an +integer containing the node, it is now a structure containing the node and +other data. However, it seems that we do not always initialise this +sysdata before we probe the device. + +Below are three examples from a boot with this checked for. The attached +patch ensures that we supply a valid sysdata for system busses. Currently +we take no account of the node for this bus for no ACPI configured systems. + This is unchanged from the -mm1 code. + + Intel(R) PRO/1000 Network Driver - version 6.1.16-k2 + Copyright (c) 1999-2005 Intel Corporation. + pci_call_probe: starting drv<c03d4be0> dev<dfd16800> id<c03d4734> + pci_call_probe: dev->bus<dfce6800> + pci_call_probe: dev->bus->sysdata<00000000> + pci_call_probe: node<-1> + e1000: eth0: e1000_probe: Intel(R) PRO/1000 Network Connection + + pci_call_probe: starting drv<c03ef220> dev<dfd17400> id<c03eed00> + pci_call_probe: dev->bus<dfce6800> + pci_call_probe: dev->bus->sysdata<00000000> + pci_call_probe: node<-1> + Linux Tulip driver version 1.1.13 (December 15, 2004) + input: AT Translated Set 2 keyboard as /class/input/input0 + tulip0: EEPROM default media type Autosense. + tulip0: Index #0 - Media 10baseT (#0) described by a + 21140 non-MII (0) block. + tulip0: Index #1 - Media 100baseTx (#3) described by a + 21140 non-MII (0) block. + tulip0: Index #2 - Media 10baseT-FDX (#4) described by a + 21140 non-MII (0) block. + tulip0: Index #3 - Media 100baseTx-FDX (#5) described by a + 21140 non-MII (0) block. + eth1: Digital DS21140 Tulip rev 33 at 0001fc00, + 00:00:BC:0F:08:96, IRQ 28. + + pci_call_probe: starting drv<c040a360> dev<dfd14400> id<c040a0fc> + pci_call_probe: dev->bus<dfce6600> + pci_call_probe: dev->bus->sysdata<dfffafa0> + pci_call_probe: node<0> + qla1280: QLA1040 found on PCI bus 0, dev 11 + +Signed-off-by: Andy Whitcroft <apw@shadowen.org> +Cc: Jeff Garzik <jgarzik@pobox.com> +Cc: "Martin J. Bligh" <mbligh@mbligh.org> +Signed-off-by: Andrew Morton <akpm@osdl.org> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> +--- + arch/i386/pci/common.c | 2 ++ + arch/i386/pci/fixup.c | 8 +++++--- + arch/i386/pci/legacy.c | 3 ++- + arch/i386/pci/numa.c | 8 +++++--- + arch/i386/pci/visws.c | 4 ++-- + include/asm-i386/pci.h | 1 + + 6 files changed, 17 insertions(+), 9 deletions(-) + +--- gregkh-2.6.orig/arch/i386/pci/common.c ++++ gregkh-2.6/arch/i386/pci/common.c +@@ -29,6 +29,8 @@ unsigned long pirq_table_addr; + struct pci_bus *pci_root_bus; + struct pci_raw_ops *raw_pci_ops; + ++struct pci_sysdata pci_default_sysdata = { .node = -1 }; ++ + static int pci_read(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 *value) + { + return raw_pci_ops->read(pci_domain_nr(bus), bus->number, +--- gregkh-2.6.orig/arch/i386/pci/fixup.c ++++ gregkh-2.6/arch/i386/pci/fixup.c +@@ -25,9 +25,11 @@ static void __devinit pci_fixup_i450nx(s + pci_read_config_byte(d, reg++, &subb); + DBG("i450NX PXB %d: %02x/%02x/%02x\n", pxb, busno, suba, subb); + if (busno) +- pci_scan_bus(busno, &pci_root_ops, NULL); /* Bus A */ ++ pci_scan_bus(busno, &pci_root_ops, ++ &pci_default_sysdata); /* Bus A */ + if (suba < subb) +- pci_scan_bus(suba+1, &pci_root_ops, NULL); /* Bus B */ ++ pci_scan_bus(suba+1, &pci_root_ops, ++ &pci_default_sysdata); /* Bus B */ + } + pcibios_last_bus = -1; + } +@@ -42,7 +44,7 @@ static void __devinit pci_fixup_i450gx(s + u8 busno; + pci_read_config_byte(d, 0x4a, &busno); + printk(KERN_INFO "PCI: i440KX/GX host bridge %s: secondary bus %02x\n", pci_name(d), busno); +- pci_scan_bus(busno, &pci_root_ops, NULL); ++ pci_scan_bus(busno, &pci_root_ops, &pci_default_sysdata); + pcibios_last_bus = -1; + } + DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82454GX, pci_fixup_i450gx); +--- gregkh-2.6.orig/arch/i386/pci/legacy.c ++++ gregkh-2.6/arch/i386/pci/legacy.c +@@ -26,7 +26,8 @@ static void __devinit pcibios_fixup_peer + l != 0x0000 && l != 0xffff) { + DBG("Found device at %02x:%02x [%04x]\n", n, devfn, l); + printk(KERN_INFO "PCI: Discovered peer bus %02x\n", n); +- pci_scan_bus(n, &pci_root_ops, NULL); ++ pci_scan_bus(n, &pci_root_ops, ++ &pci_default_sysdata); + break; + } + } +--- gregkh-2.6.orig/arch/i386/pci/numa.c ++++ gregkh-2.6/arch/i386/pci/numa.c +@@ -97,9 +97,11 @@ static void __devinit pci_fixup_i450nx(s + pci_read_config_byte(d, reg++, &subb); + DBG("i450NX PXB %d: %02x/%02x/%02x\n", pxb, busno, suba, subb); + if (busno) +- pci_scan_bus(QUADLOCAL2BUS(quad,busno), &pci_root_ops, NULL); /* Bus A */ ++ pci_scan_bus(QUADLOCAL2BUS(quad,busno), &pci_root_ops, ++ &pci_default_sysdata); /* Bus A */ + if (suba < subb) +- pci_scan_bus(QUADLOCAL2BUS(quad,suba+1), &pci_root_ops, NULL); /* Bus B */ ++ pci_scan_bus(QUADLOCAL2BUS(quad,suba+1), &pci_root_ops, ++ &pci_default_sysdata); /* Bus B */ + } + pcibios_last_bus = -1; + } +@@ -124,7 +126,7 @@ static int __init pci_numa_init(void) + printk("Scanning PCI bus %d for quad %d\n", + QUADLOCAL2BUS(quad,0), quad); + pci_scan_bus(QUADLOCAL2BUS(quad,0), +- &pci_root_ops, NULL); ++ &pci_root_ops, &pci_default_sysdata); + } + return 0; + } +--- gregkh-2.6.orig/arch/i386/pci/visws.c ++++ gregkh-2.6/arch/i386/pci/visws.c +@@ -102,8 +102,8 @@ static int __init pcibios_init(void) + "bridge B (PIIX4) bus: %u\n", pci_bus1, pci_bus0); + + raw_pci_ops = &pci_direct_conf1; +- pci_scan_bus(pci_bus0, &pci_root_ops, NULL); +- pci_scan_bus(pci_bus1, &pci_root_ops, NULL); ++ pci_scan_bus(pci_bus0, &pci_root_ops, &pci_default_sysdata); ++ pci_scan_bus(pci_bus1, &pci_root_ops, &pci_default_sysdata); + pci_fixup_irqs(visws_swizzle, visws_map_irq); + pcibios_resource_survey(); + return 0; +--- gregkh-2.6.orig/include/asm-i386/pci.h ++++ gregkh-2.6/include/asm-i386/pci.h +@@ -9,6 +9,7 @@ struct pci_sysdata { + int domain; /* PCI domain */ + int node; /* NUMA node */ + }; ++extern struct pci_sysdata pci_default_sysdata; + + #ifdef CONFIG_PCI_DOMAINS + static inline int pci_domain_nr(struct pci_bus *bus) diff --git a/bad/pci-domain/pci-fix-the-x86-pci-domain-support-fix.patch b/bad/pci-domain/pci-fix-the-x86-pci-domain-support-fix.patch new file mode 100644 index 0000000000000..960720fc7cac5 --- /dev/null +++ b/bad/pci-domain/pci-fix-the-x86-pci-domain-support-fix.patch @@ -0,0 +1,39 @@ +From akpm@osdl.org Fri Feb 3 01:46:31 2006 +Message-Id: <200602030946.k139kIW6002410@shell0.pdx.osdl.net> +Subject: PCI: fix the x86 pci domain support fix +To: greg@kroah.com +Cc: akpm@osdl.org, apw@shadowen.org, jgarzik@pobox.com, mbligh@aracnet.com +From: akpm@osdl.org +Date: Fri, 03 Feb 2006 01:45:58 -0800 + + +From: Andrew Morton <akpm@osdl.org> + +x86_64 needs this declared too.. + +arch/x86_64/pci/../../i386/pci/fixup.c: In function `pci_fixup_i450nx': +arch/x86_64/pci/../../i386/pci/fixup.c:29: error: `pci_default_sysdata' undeclared (first use in this function) +arch/x86_64/pci/../../i386/pci/fixup.c:29: error: (Each undeclared identifier is reported only once +arch/x86_64/pci/../../i386/pci/fixup.c:29: error: for each function it appears in.) +arch/x86_64/pci/../../i386/pci/fixup.c: In function `pci_fixup_i450gx': +arch/x86_64/pci/../../i386/pci/fixup.c:47: error: `pci_default_sysdata' undeclared (first use in this function) + +Cc: Andy Whitcroft <apw@shadowen.org> +Cc: Jeff Garzik <jgarzik@pobox.com> +Cc: "Martin J. Bligh" <mbligh@mbligh.org> +Signed-off-by: Andrew Morton <akpm@osdl.org> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> +--- + include/asm-x86_64/pci.h | 1 + + 1 file changed, 1 insertion(+) + +--- gregkh-2.6.orig/include/asm-x86_64/pci.h ++++ gregkh-2.6/include/asm-x86_64/pci.h +@@ -10,6 +10,7 @@ struct pci_sysdata { + int domain; /* PCI domain */ + int node; /* NUMA node */ + }; ++extern struct pci_sysdata pci_default_sysdata; + + #ifdef CONFIG_PCI_DOMAINS + static inline int pci_domain_nr(struct pci_bus *bus) diff --git a/bad/pci-domain/series b/bad/pci-domain/series new file mode 100644 index 0000000000000..297b61f521191 --- /dev/null +++ b/bad/pci-domain/series @@ -0,0 +1,6 @@ +# PCI Domain patches. Apply in this order +x86-pci-domain-support-a-humble-fix.patch +x86-pci-domain-support-struct-pci_sysdata.patch +x86-pci-domain-support-the-meat.patch +pci-fix-the-x86-pci-domain-support-fix.patch +pci-device-ensure-sysdata-initialised.patch diff --git a/bad/pci-domain/x86-pci-domain-support-a-humble-fix.patch b/bad/pci-domain/x86-pci-domain-support-a-humble-fix.patch new file mode 100644 index 0000000000000..b6712113f14d0 --- /dev/null +++ b/bad/pci-domain/x86-pci-domain-support-a-humble-fix.patch @@ -0,0 +1,40 @@ +From garzik@havoc.gtf.org Fri Dec 2 19:24:13 2005 +Date: Fri, 2 Dec 2005 20:39:41 -0500 +From: Jeff Garzik <jgarzik@pobox.com> +Cc: <gregkh@suse.de>, <ak@suse.de> +Subject: [PATCH 1/3] x86 PCI domain support: a humble fix +Message-ID: <20051203013941.GA2663@havoc.gtf.org> +Content-Disposition: inline + +From: Jeff Garzik <jgarzik@pobox.com> + +[x86, PCI] pass PCI domain number to PCI config read/write hooks + +Don't hardcode zero, since modern x86 (with special ACPI sauce) +can support multiple "PCI segments", aka PCI domains. + +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + arch/i386/pci/common.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +--- gregkh-2.6.orig/arch/i386/pci/common.c ++++ gregkh-2.6/arch/i386/pci/common.c +@@ -31,12 +31,14 @@ struct pci_raw_ops *raw_pci_ops; + + static int pci_read(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 *value) + { +- return raw_pci_ops->read(0, bus->number, devfn, where, size, value); ++ return raw_pci_ops->read(pci_domain_nr(bus), bus->number, ++ devfn, where, size, value); + } + + static int pci_write(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 value) + { +- return raw_pci_ops->write(0, bus->number, devfn, where, size, value); ++ return raw_pci_ops->write(pci_domain_nr(bus), bus->number, ++ devfn, where, size, value); + } + + struct pci_ops pci_root_ops = { diff --git a/bad/pci-domain/x86-pci-domain-support-struct-pci_sysdata.patch b/bad/pci-domain/x86-pci-domain-support-struct-pci_sysdata.patch new file mode 100644 index 0000000000000..507079820e9db --- /dev/null +++ b/bad/pci-domain/x86-pci-domain-support-struct-pci_sysdata.patch @@ -0,0 +1,150 @@ +From garzik@havoc.gtf.org Fri Dec 2 19:24:13 2005 +Date: Fri, 2 Dec 2005 20:40:06 -0500 +From: Jeff Garzik <jgarzik@pobox.com> +Cc: <gregkh@suse.de>, <ak@suse.de> +Subject: [PATCH 2/3] x86 PCI domain support: struct pci_sysdata +Message-ID: <20051203014006.GB2663@havoc.gtf.org> +Content-Disposition: inline + + +[x86, PCI] Switch pci_bus::sysdata from NUMA node integer to a pointer + +On x86[-64], struct pci_bus::sysdata is only used on NUMA platforms, +to store the associated NUMA node. + +Preparing for the future when we'll want to do other things with +sysdata, struct pci_sysdata was created. An allocated structure +replaces the cast-pointer-to-int NUMA usage. Updated all NUMA users. + +From: Jeff Garzik <jgarzik@pobox.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + + +--- + arch/i386/pci/acpi.c | 7 ++++--- + arch/i386/pci/common.c | 13 ++++++++++++- + arch/x86_64/pci/k8-bus.c | 6 +++++- + include/asm-i386/pci.h | 5 +++++ + include/asm-i386/topology.h | 2 +- + include/asm-x86_64/pci.h | 4 ++++ + include/asm-x86_64/topology.h | 2 +- + 7 files changed, 32 insertions(+), 7 deletions(-) + +--- gregkh-2.6.orig/arch/i386/pci/acpi.c ++++ gregkh-2.6/arch/i386/pci/acpi.c +@@ -19,9 +19,10 @@ struct pci_bus * __devinit pci_acpi_scan + if (bus != NULL) { + int pxm = acpi_get_pxm(device->handle); + if (pxm >= 0) { +- bus->sysdata = (void *)(unsigned long)pxm_to_node(pxm); +- printk("bus %d -> pxm %d -> node %ld\n", +- busnum, pxm, (long)(bus->sysdata)); ++ struct pci_sysdata *sd = bus->sysdata; ++ sd->node = pxm_to_node(pxm); ++ printk("bus %d -> pxm %d -> node %d\n", ++ busnum, pxm, sd->node); + } + } + #endif +--- gregkh-2.6.orig/arch/i386/pci/common.c ++++ gregkh-2.6/arch/i386/pci/common.c +@@ -126,6 +126,7 @@ void __devinit pcibios_fixup_bus(struct + struct pci_bus * __devinit pcibios_scan_root(int busnum) + { + struct pci_bus *bus = NULL; ++ struct pci_sysdata *sd; + + while ((bus = pci_find_next_bus(bus)) != NULL) { + if (bus->number == busnum) { +@@ -134,9 +135,19 @@ struct pci_bus * __devinit pcibios_scan_ + } + } + ++ /* 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; ++ } ++ + printk(KERN_DEBUG "PCI: Probing PCI hardware (bus %02x)\n", busnum); + +- return pci_scan_bus_parented(NULL, busnum, &pci_root_ops, NULL); ++ return pci_scan_bus_parented(NULL, busnum, &pci_root_ops, sd); + } + + extern u8 pci_cache_line_size; +--- gregkh-2.6.orig/arch/x86_64/pci/k8-bus.c ++++ gregkh-2.6/arch/x86_64/pci/k8-bus.c +@@ -59,6 +59,8 @@ fill_mp_bus_to_cpumask(void) + j <= SUBORDINATE_LDT_BUS_NUMBER(ldtbus); + j++) { + struct pci_bus *bus; ++ struct pci_sysdata *sd; ++ + long node = NODE_ID(nid); + /* Algorithm a bit dumb, but + it shouldn't matter here */ +@@ -67,7 +69,9 @@ fill_mp_bus_to_cpumask(void) + continue; + if (!node_online(node)) + node = 0; +- bus->sysdata = (void *)node; ++ ++ sd = bus->sysdata; ++ sd->node = node; + } + } + } +--- gregkh-2.6.orig/include/asm-i386/pci.h ++++ gregkh-2.6/include/asm-i386/pci.h +@@ -4,6 +4,11 @@ + #include <linux/config.h> + + #ifdef __KERNEL__ ++ ++struct pci_sysdata { ++ int node; /* NUMA node */ ++}; ++ + #include <linux/mm.h> /* for struct page */ + + /* Can be used to override the logic in pci_scan_bus for skipping +--- gregkh-2.6.orig/include/asm-i386/topology.h ++++ gregkh-2.6/include/asm-i386/topology.h +@@ -69,7 +69,7 @@ static inline int node_to_first_cpu(int + return first_cpu(mask); + } + +-#define pcibus_to_node(bus) ((long) (bus)->sysdata) ++#define pcibus_to_node(bus) ((struct pci_sysdata *)((bus)->sysdata))->node + #define pcibus_to_cpumask(bus) node_to_cpumask(pcibus_to_node(bus)) + + /* sched_domains SD_NODE_INIT for NUMAQ machines */ +--- gregkh-2.6.orig/include/asm-x86_64/pci.h ++++ gregkh-2.6/include/asm-x86_64/pci.h +@@ -6,6 +6,10 @@ + + #ifdef __KERNEL__ + ++struct pci_sysdata { ++ int node; /* NUMA node */ ++}; ++ + #include <linux/mm.h> /* for struct page */ + + /* Can be used to override the logic in pci_scan_bus for skipping +--- gregkh-2.6.orig/include/asm-x86_64/topology.h ++++ gregkh-2.6/include/asm-x86_64/topology.h +@@ -25,7 +25,7 @@ extern int __node_distance(int, int); + #define parent_node(node) (node) + #define node_to_first_cpu(node) (first_cpu(node_to_cpumask[node])) + #define node_to_cpumask(node) (node_to_cpumask[node]) +-#define pcibus_to_node(bus) ((long)(bus->sysdata)) ++#define pcibus_to_node(bus) ((struct pci_sysdata *)((bus)->sysdata))->node + #define pcibus_to_cpumask(bus) node_to_cpumask(pcibus_to_node(bus)); + + #define numa_node_id() read_pda(nodenumber) diff --git a/bad/pci-domain/x86-pci-domain-support-the-meat.patch b/bad/pci-domain/x86-pci-domain-support-the-meat.patch new file mode 100644 index 0000000000000..0101d2b5dc03a --- /dev/null +++ b/bad/pci-domain/x86-pci-domain-support-the-meat.patch @@ -0,0 +1,116 @@ +From garzik@havoc.gtf.org Fri Dec 2 19:24:13 2005 +Date: Fri, 2 Dec 2005 20:40:33 -0500 +From: Jeff Garzik <jgarzik@pobox.com> +To: linux-kernel@vger.kernel.org +Cc: <gregkh@suse.de>, <ak@suse.de> +Subject: [PATCH 3/3] x86 PCI domain support: the meat +Message-ID: <20051203014033.GC2663@havoc.gtf.org> +Content-Disposition: inline + + +[x86, PCI] add PCI domain support + +* Store PCI domain in struct pci_sysdata +* Add magic inlines to pass PCI domain to read/write config hooks +* Support ACPI's notion of PCI domains (PCI segments) + +From: Jeff Garzik <jgarzik@pobox.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + arch/i386/pci/acpi.c | 20 ++++++++++++++++++-- + include/asm-i386/pci.h | 14 ++++++++++++++ + include/asm-x86_64/pci.h | 14 ++++++++++++++ + 3 files changed, 46 insertions(+), 2 deletions(-) + +--- gregkh-2.6.orig/arch/i386/pci/acpi.c ++++ gregkh-2.6/arch/i386/pci/acpi.c +@@ -8,18 +8,34 @@ + struct pci_bus * __devinit pci_acpi_scan_root(struct acpi_device *device, int domain, int busnum) + { + struct pci_bus *bus; ++ struct pci_sysdata *sd; + ++ /* 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; ++ } ++ ++#ifdef CONFIG_PCI_DOMAINS ++ sd->domain = domain; ++#else + if (domain != 0) { + printk(KERN_WARNING "PCI: Multiple domains not supported\n"); + return NULL; + } ++#endif /* CONFIG_PCI_DOMAINS */ + +- bus = pcibios_scan_root(busnum); ++ bus = pci_scan_bus_parented(NULL, busnum, &pci_root_ops, sd); ++ if (!bus) ++ kfree(sd); + #ifdef CONFIG_ACPI_NUMA + if (bus != NULL) { + int pxm = acpi_get_pxm(device->handle); + if (pxm >= 0) { +- struct pci_sysdata *sd = bus->sysdata; + sd->node = pxm_to_node(pxm); + printk("bus %d -> pxm %d -> node %d\n", + busnum, pxm, sd->node); +--- gregkh-2.6.orig/include/asm-i386/pci.h ++++ gregkh-2.6/include/asm-i386/pci.h +@@ -6,9 +6,23 @@ + #ifdef __KERNEL__ + + struct pci_sysdata { ++ int domain; /* PCI domain */ + int node; /* NUMA node */ + }; + ++#ifdef CONFIG_PCI_DOMAINS ++static inline int pci_domain_nr(struct pci_bus *bus) ++{ ++ struct pci_sysdata *sd = bus->sysdata; ++ return sd->domain; ++} ++ ++static inline int pci_proc_domain(struct pci_bus *bus) ++{ ++ return pci_domain_nr(bus); ++} ++#endif /* CONFIG_PCI_DOMAINS */ ++ + #include <linux/mm.h> /* for struct page */ + + /* Can be used to override the logic in pci_scan_bus for skipping +--- gregkh-2.6.orig/include/asm-x86_64/pci.h ++++ gregkh-2.6/include/asm-x86_64/pci.h +@@ -7,9 +7,23 @@ + #ifdef __KERNEL__ + + struct pci_sysdata { ++ int domain; /* PCI domain */ + int node; /* NUMA node */ + }; + ++#ifdef CONFIG_PCI_DOMAINS ++static inline int pci_domain_nr(struct pci_bus *bus) ++{ ++ struct pci_sysdata *sd = bus->sysdata; ++ return sd->domain; ++} ++ ++static inline int pci_proc_domain(struct pci_bus *bus) ++{ ++ return pci_domain_nr(bus); ++} ++#endif /* CONFIG_PCI_DOMAINS */ ++ + #include <linux/mm.h> /* for struct page */ + + /* Can be used to override the logic in pci_scan_bus for skipping |