aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/pci/acpi.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/pci/acpi.c')
-rw-r--r--arch/x86/pci/acpi.c59
1 files changed, 18 insertions, 41 deletions
diff --git a/arch/x86/pci/acpi.c b/arch/x86/pci/acpi.c
index 4f25ec077552..01edac6c5e18 100644
--- a/arch/x86/pci/acpi.c
+++ b/arch/x86/pci/acpi.c
@@ -218,9 +218,8 @@ static void teardown_mcfg_map(struct pci_root_info *info)
218} 218}
219#endif 219#endif
220 220
221static acpi_status 221static acpi_status resource_to_addr(struct acpi_resource *resource,
222resource_to_addr(struct acpi_resource *resource, 222 struct acpi_resource_address64 *addr)
223 struct acpi_resource_address64 *addr)
224{ 223{
225 acpi_status status; 224 acpi_status status;
226 struct acpi_resource_memory24 *memory24; 225 struct acpi_resource_memory24 *memory24;
@@ -265,8 +264,7 @@ resource_to_addr(struct acpi_resource *resource,
265 return AE_ERROR; 264 return AE_ERROR;
266} 265}
267 266
268static acpi_status 267static acpi_status count_resource(struct acpi_resource *acpi_res, void *data)
269count_resource(struct acpi_resource *acpi_res, void *data)
270{ 268{
271 struct pci_root_info *info = data; 269 struct pci_root_info *info = data;
272 struct acpi_resource_address64 addr; 270 struct acpi_resource_address64 addr;
@@ -278,8 +276,7 @@ count_resource(struct acpi_resource *acpi_res, void *data)
278 return AE_OK; 276 return AE_OK;
279} 277}
280 278
281static acpi_status 279static acpi_status setup_resource(struct acpi_resource *acpi_res, void *data)
282setup_resource(struct acpi_resource *acpi_res, void *data)
283{ 280{
284 struct pci_root_info *info = data; 281 struct pci_root_info *info = data;
285 struct resource *res; 282 struct resource *res;
@@ -435,9 +432,9 @@ static void release_pci_root_info(struct pci_host_bridge *bridge)
435 __release_pci_root_info(info); 432 __release_pci_root_info(info);
436} 433}
437 434
438static void 435static void probe_pci_root_info(struct pci_root_info *info,
439probe_pci_root_info(struct pci_root_info *info, struct acpi_device *device, 436 struct acpi_device *device,
440 int busnum, int domain) 437 int busnum, int domain)
441{ 438{
442 size_t size; 439 size_t size;
443 440
@@ -473,16 +470,13 @@ probe_pci_root_info(struct pci_root_info *info, struct acpi_device *device,
473struct pci_bus *pci_acpi_scan_root(struct acpi_pci_root *root) 470struct pci_bus *pci_acpi_scan_root(struct acpi_pci_root *root)
474{ 471{
475 struct acpi_device *device = root->device; 472 struct acpi_device *device = root->device;
476 struct pci_root_info *info = NULL; 473 struct pci_root_info *info;
477 int domain = root->segment; 474 int domain = root->segment;
478 int busnum = root->secondary.start; 475 int busnum = root->secondary.start;
479 LIST_HEAD(resources); 476 LIST_HEAD(resources);
480 struct pci_bus *bus = NULL; 477 struct pci_bus *bus;
481 struct pci_sysdata *sd; 478 struct pci_sysdata *sd;
482 int node; 479 int node;
483#ifdef CONFIG_ACPI_NUMA
484 int pxm;
485#endif
486 480
487 if (pci_ignore_seg) 481 if (pci_ignore_seg)
488 domain = 0; 482 domain = 0;
@@ -494,19 +488,12 @@ struct pci_bus *pci_acpi_scan_root(struct acpi_pci_root *root)
494 return NULL; 488 return NULL;
495 } 489 }
496 490
497 node = -1; 491 node = acpi_get_node(device->handle);
498#ifdef CONFIG_ACPI_NUMA 492 if (node == NUMA_NO_NODE)
499 pxm = acpi_get_pxm(device->handle); 493 node = x86_pci_root_bus_node(busnum);
500 if (pxm >= 0)
501 node = pxm_to_node(pxm);
502 if (node != -1)
503 set_mp_bus_to_node(busnum, node);
504 else
505#endif
506 node = get_mp_bus_to_node(busnum);
507 494
508 if (node != -1 && !node_online(node)) 495 if (node != NUMA_NO_NODE && !node_online(node))
509 node = -1; 496 node = NUMA_NO_NODE;
510 497
511 info = kzalloc(sizeof(*info), GFP_KERNEL); 498 info = kzalloc(sizeof(*info), GFP_KERNEL);
512 if (!info) { 499 if (!info) {
@@ -519,15 +506,12 @@ struct pci_bus *pci_acpi_scan_root(struct acpi_pci_root *root)
519 sd->domain = domain; 506 sd->domain = domain;
520 sd->node = node; 507 sd->node = node;
521 sd->companion = device; 508 sd->companion = device;
522 /* 509
523 * Maybe the desired pci bus has been already scanned. In such case
524 * it is unnecessary to scan the pci bus with the given domain,busnum.
525 */
526 bus = pci_find_bus(domain, busnum); 510 bus = pci_find_bus(domain, busnum);
527 if (bus) { 511 if (bus) {
528 /* 512 /*
529 * If the desired bus exits, the content of bus->sysdata will 513 * If the desired bus has been scanned already, replace
530 * be replaced by sd. 514 * its bus->sysdata.
531 */ 515 */
532 memcpy(bus->sysdata, sd, sizeof(*sd)); 516 memcpy(bus->sysdata, sd, sizeof(*sd));
533 kfree(info); 517 kfree(info);
@@ -572,15 +556,8 @@ struct pci_bus *pci_acpi_scan_root(struct acpi_pci_root *root)
572 pcie_bus_configure_settings(child); 556 pcie_bus_configure_settings(child);
573 } 557 }
574 558
575 if (bus && node != -1) { 559 if (bus && node != NUMA_NO_NODE)
576#ifdef CONFIG_ACPI_NUMA
577 if (pxm >= 0)
578 dev_printk(KERN_DEBUG, &bus->dev,
579 "on NUMA node %d (pxm %d)\n", node, pxm);
580#else
581 dev_printk(KERN_DEBUG, &bus->dev, "on NUMA node %d\n", node); 560 dev_printk(KERN_DEBUG, &bus->dev, "on NUMA node %d\n", node);
582#endif
583 }
584 561
585 return bus; 562 return bus;
586} 563}