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 /include/asm-powerpc/pci-bridge.h | |
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 'include/asm-powerpc/pci-bridge.h')
-rw-r--r-- | include/asm-powerpc/pci-bridge.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/asm-powerpc/pci-bridge.h b/include/asm-powerpc/pci-bridge.h index 84a3075db524..4f55573762bb 100644 --- a/include/asm-powerpc/pci-bridge.h +++ b/include/asm-powerpc/pci-bridge.h | |||
@@ -6,6 +6,7 @@ | |||
6 | #include <asm-ppc/pci-bridge.h> | 6 | #include <asm-ppc/pci-bridge.h> |
7 | #else | 7 | #else |
8 | 8 | ||
9 | #include <linux/config.h> | ||
9 | #include <linux/pci.h> | 10 | #include <linux/pci.h> |
10 | #include <linux/list.h> | 11 | #include <linux/list.h> |
11 | 12 | ||
@@ -22,6 +23,7 @@ | |||
22 | struct pci_controller { | 23 | struct pci_controller { |
23 | struct pci_bus *bus; | 24 | struct pci_bus *bus; |
24 | char is_dynamic; | 25 | char is_dynamic; |
26 | int node; | ||
25 | void *arch_data; | 27 | void *arch_data; |
26 | struct list_head list_node; | 28 | struct list_head list_node; |
27 | 29 | ||
@@ -165,6 +167,12 @@ static inline unsigned long pci_address_to_pio(phys_addr_t address) | |||
165 | #define PCI_PROBE_NORMAL 0 /* Do normal PCI probing */ | 167 | #define PCI_PROBE_NORMAL 0 /* Do normal PCI probing */ |
166 | #define PCI_PROBE_DEVTREE 1 /* Instantiate from device tree */ | 168 | #define PCI_PROBE_DEVTREE 1 /* Instantiate from device tree */ |
167 | 169 | ||
170 | #ifdef CONFIG_NUMA | ||
171 | #define PHB_SET_NODE(PHB, NODE) ((PHB)->node = (NODE)) | ||
172 | #else | ||
173 | #define PHB_SET_NODE(PHB, NODE) ((PHB)->node = -1) | ||
174 | #endif | ||
175 | |||
168 | #endif /* CONFIG_PPC64 */ | 176 | #endif /* CONFIG_PPC64 */ |
169 | #endif /* __KERNEL__ */ | 177 | #endif /* __KERNEL__ */ |
170 | #endif | 178 | #endif |