aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Lameter <clameter@sgi.com>2005-07-07 19:59:00 -0400
committerTony Luck <tony.luck@intel.com>2005-07-12 14:04:22 -0400
commit514604c6d1779c55d3e97dc4e9a71c117c1ccbcd (patch)
tree19241b4db64f1da60c0dd594606c5d5fba8b254f
parent1604d9c8f8dffafe3a077dc5ae7c935d2318bcf6 (diff)
[IA64] pcibus_to_node implementation for IA64
pcibus_to_node provides a way for the Linux kernel to identify to which node a certain pcibus connects to. Allocations of control structures for devices can then be made on the node where the pci bus is located to allow local access during interrupt and other device manipulation. This patch provides a new "node" field in the the pci_controller structure. The node field will be set based on ACPI information (thanks to Alex Williamson <alex.williamson@hp.com for that piece). Signed-off-by: Christoph Lameter <clameter@sgi.com> Signed-off-by: Tony Luck <tony.luck@intel.com>
-rw-r--r--arch/ia64/pci/pci.c12
-rw-r--r--include/asm-ia64/pci.h1
-rw-r--r--include/asm-ia64/topology.h5
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
43void build_cpu_to_node_map(void); 48void build_cpu_to_node_map(void);
44 49
45#define SD_CPU_INIT (struct sched_domain) { \ 50#define SD_CPU_INIT (struct sched_domain) { \