diff options
-rw-r--r-- | arch/ia64/pci/pci.c | 12 | ||||
-rw-r--r-- | include/asm-ia64/pci.h | 1 | ||||
-rw-r--r-- | include/asm-ia64/topology.h | 5 |
3 files changed, 16 insertions, 2 deletions
diff --git a/arch/ia64/pci/pci.c b/arch/ia64/pci/pci.c index 720a861f88be..54d9ed444e4a 100644 --- a/arch/ia64/pci/pci.c +++ b/arch/ia64/pci/pci.c | |||
@@ -157,6 +157,7 @@ alloc_pci_controller (int seg) | |||
157 | 157 | ||
158 | memset(controller, 0, sizeof(*controller)); | 158 | memset(controller, 0, sizeof(*controller)); |
159 | controller->segment = seg; | 159 | controller->segment = seg; |
160 | controller->node = -1; | ||
160 | return controller; | 161 | return controller; |
161 | } | 162 | } |
162 | 163 | ||
@@ -288,6 +289,7 @@ pci_acpi_scan_root(struct acpi_device *device, int domain, int bus) | |||
288 | unsigned int windows = 0; | 289 | unsigned int windows = 0; |
289 | struct pci_bus *pbus; | 290 | struct pci_bus *pbus; |
290 | char *name; | 291 | char *name; |
292 | int pxm; | ||
291 | 293 | ||
292 | controller = alloc_pci_controller(domain); | 294 | controller = alloc_pci_controller(domain); |
293 | if (!controller) | 295 | if (!controller) |
@@ -295,10 +297,16 @@ pci_acpi_scan_root(struct acpi_device *device, int domain, int bus) | |||
295 | 297 | ||
296 | controller->acpi_handle = device->handle; | 298 | controller->acpi_handle = device->handle; |
297 | 299 | ||
300 | pxm = acpi_get_pxm(controller->acpi_handle); | ||
301 | #ifdef CONFIG_NUMA | ||
302 | if (pxm >= 0) | ||
303 | controller->node = pxm_to_nid_map[pxm]; | ||
304 | #endif | ||
305 | |||
298 | acpi_walk_resources(device->handle, METHOD_NAME__CRS, count_window, | 306 | acpi_walk_resources(device->handle, METHOD_NAME__CRS, count_window, |
299 | &windows); | 307 | &windows); |
300 | controller->window = kmalloc(sizeof(*controller->window) * windows, | 308 | controller->window = kmalloc_node(sizeof(*controller->window) * windows, |
301 | GFP_KERNEL); | 309 | GFP_KERNEL, controller->node); |
302 | if (!controller->window) | 310 | if (!controller->window) |
303 | goto out2; | 311 | goto out2; |
304 | 312 | ||
diff --git a/include/asm-ia64/pci.h b/include/asm-ia64/pci.h index 0c4c5d801d3f..8b7237cc84c1 100644 --- a/include/asm-ia64/pci.h +++ b/include/asm-ia64/pci.h | |||
@@ -128,6 +128,7 @@ struct pci_controller { | |||
128 | void *acpi_handle; | 128 | void *acpi_handle; |
129 | void *iommu; | 129 | void *iommu; |
130 | int segment; | 130 | int segment; |
131 | int node; /* nearest node with memory or -1 for global allocation */ | ||
131 | 132 | ||
132 | unsigned int windows; | 133 | unsigned int windows; |
133 | struct pci_window *window; | 134 | struct pci_window *window; |
diff --git a/include/asm-ia64/topology.h b/include/asm-ia64/topology.h index 4e64c2a6b369..399bc29729fd 100644 --- a/include/asm-ia64/topology.h +++ b/include/asm-ia64/topology.h | |||
@@ -40,6 +40,11 @@ | |||
40 | */ | 40 | */ |
41 | #define node_to_first_cpu(node) (__ffs(node_to_cpumask(node))) | 41 | #define node_to_first_cpu(node) (__ffs(node_to_cpumask(node))) |
42 | 42 | ||
43 | /* | ||
44 | * Determines the node for a given pci bus | ||
45 | */ | ||
46 | #define pcibus_to_node(bus) PCI_CONTROLLER(bus)->node | ||
47 | |||
43 | void build_cpu_to_node_map(void); | 48 | void build_cpu_to_node_map(void); |
44 | 49 | ||
45 | #define SD_CPU_INIT (struct sched_domain) { \ | 50 | #define SD_CPU_INIT (struct sched_domain) { \ |