diff options
-rw-r--r-- | arch/powerpc/kernel/pci_64.c | 13 | ||||
-rw-r--r-- | include/asm-powerpc/pci-bridge.h | 8 | ||||
-rw-r--r-- | include/asm-powerpc/topology.h | 14 |
3 files changed, 27 insertions, 8 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 | ||
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 |
diff --git a/include/asm-powerpc/topology.h b/include/asm-powerpc/topology.h index b7abd423c570..f4c759b5f6cc 100644 --- a/include/asm-powerpc/topology.h +++ b/include/asm-powerpc/topology.h | |||
@@ -32,13 +32,13 @@ static inline int node_to_first_cpu(int node) | |||
32 | 32 | ||
33 | int of_node_to_nid(struct device_node *device); | 33 | int of_node_to_nid(struct device_node *device); |
34 | 34 | ||
35 | #ifdef CONFIG_PPC64 | 35 | struct pci_bus; |
36 | #define pcibus_to_node(bus) (of_node_to_nid(bus->sysdata)) | 36 | extern int pcibus_to_node(struct pci_bus *bus); |
37 | #define pcibus_to_cpumask(bus) (node_to_cpumask(of_node_to_nid(bus->sysdata))) | 37 | |
38 | #else | 38 | #define pcibus_to_cpumask(bus) (pcibus_to_node(bus) == -1 ? \ |
39 | #define pcibus_to_node(node) (-1) | 39 | CPU_MASK_ALL : \ |
40 | #define pcibus_to_cpumask(bus) (cpu_online_map) | 40 | node_to_cpumask(pcibus_to_node(bus)) \ |
41 | #endif | 41 | ) |
42 | 42 | ||
43 | /* sched_domains SD_NODE_INIT for PPC64 machines */ | 43 | /* sched_domains SD_NODE_INIT for PPC64 machines */ |
44 | #define SD_NODE_INIT (struct sched_domain) { \ | 44 | #define SD_NODE_INIT (struct sched_domain) { \ |