diff options
author | Anton Blanchard <anton@samba.org> | 2006-06-10 06:53:06 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-06-15 05:31:26 -0400 |
commit | 357518fa34d9dceda42bfc09642356a58370050d (patch) | |
tree | c75689198fa2667a3d73d89ff125d910061b4fcf /arch | |
parent | f2b09c8189bc7b64a42753e98f7006b11bae1bdc (diff) |
[POWERPC] pcibus_to_node fixes
of_node_to_nid returns -1 if the associativity cannot be found. This
means pcibus_to_cpumask has to be careful not to pass a negative index into
node_to_cpumask.
Since pcibus_to_node could be used a lot, and of_node_to_nid is slow (it
walks a list doing strcmps), lets also cache the node in the
pci_controller struct.
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/kernel/pci_64.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c index 74dc76653e1b..5ad87c426bed 100644 --- a/arch/powerpc/kernel/pci_64.c +++ b/arch/powerpc/kernel/pci_64.c | |||
@@ -227,8 +227,10 @@ struct pci_controller * pcibios_alloc_controller(struct device_node *dev) | |||
227 | pci_setup_pci_controller(phb); | 227 | pci_setup_pci_controller(phb); |
228 | phb->arch_data = dev; | 228 | phb->arch_data = dev; |
229 | phb->is_dynamic = mem_init_done; | 229 | phb->is_dynamic = mem_init_done; |
230 | if (dev) | 230 | if (dev) { |
231 | PHB_SET_NODE(phb, of_node_to_nid(dev)); | ||
231 | add_linux_pci_domain(dev, phb); | 232 | add_linux_pci_domain(dev, phb); |
233 | } | ||
232 | return phb; | 234 | return phb; |
233 | } | 235 | } |
234 | 236 | ||
@@ -1415,3 +1417,12 @@ long sys_pciconfig_iobase(long which, unsigned long in_bus, | |||
1415 | 1417 | ||
1416 | return -EOPNOTSUPP; | 1418 | return -EOPNOTSUPP; |
1417 | } | 1419 | } |
1420 | |||
1421 | #ifdef CONFIG_NUMA | ||
1422 | int pcibus_to_node(struct pci_bus *bus) | ||
1423 | { | ||
1424 | struct pci_controller *phb = pci_bus_to_host(bus); | ||
1425 | return phb->node; | ||
1426 | } | ||
1427 | EXPORT_SYMBOL(pcibus_to_node); | ||
1428 | #endif | ||