diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2012-10-30 02:24:50 -0400 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2012-11-05 18:10:16 -0500 |
commit | d4761ba2d6adbe24c792ec6223a5884ae4e82430 (patch) | |
tree | 8a455923e3d5073b12889ef7fd27fa4a26c06a2e /drivers/acpi | |
parent | 79c4412298771b8996302806abc8a11e760da9b3 (diff) |
PCI/ACPI: Add _PRT interrupt routing info before enumerating devices
We used to add the _PRT after enumerating devices behind a new host
bridge. This moves the _PRT addition *before* the enumeration, since
it no longer depends on the struct pci_bus existing. This is one
step towards consolidating the .add/.start methods.
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Taku Izumi <izumim.taku@jp.fujitsu.com>
Diffstat (limited to 'drivers/acpi')
-rw-r--r-- | drivers/acpi/pci_root.c | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c index db31edaab9ce..66f3ae74d130 100644 --- a/drivers/acpi/pci_root.c +++ b/drivers/acpi/pci_root.c | |||
@@ -501,6 +501,20 @@ static int __devinit acpi_pci_root_add(struct acpi_device *device) | |||
501 | strcpy(acpi_device_class(device), ACPI_PCI_ROOT_CLASS); | 501 | strcpy(acpi_device_class(device), ACPI_PCI_ROOT_CLASS); |
502 | device->driver_data = root; | 502 | device->driver_data = root; |
503 | 503 | ||
504 | printk(KERN_INFO PREFIX "%s [%s] (domain %04x %pR)\n", | ||
505 | acpi_device_name(device), acpi_device_bid(device), | ||
506 | root->segment, &root->secondary); | ||
507 | |||
508 | /* | ||
509 | * PCI Routing Table | ||
510 | * ----------------- | ||
511 | * Evaluate and parse _PRT, if exists. | ||
512 | */ | ||
513 | status = acpi_get_handle(device->handle, METHOD_NAME__PRT, &handle); | ||
514 | if (ACPI_SUCCESS(status)) | ||
515 | result = acpi_pci_irq_add_prt(device->handle, root->segment, | ||
516 | root->secondary.start); | ||
517 | |||
504 | root->mcfg_addr = acpi_pci_root_get_mcfg_addr(device->handle); | 518 | root->mcfg_addr = acpi_pci_root_get_mcfg_addr(device->handle); |
505 | 519 | ||
506 | /* | 520 | /* |
@@ -518,10 +532,6 @@ static int __devinit acpi_pci_root_add(struct acpi_device *device) | |||
518 | list_add_tail(&root->node, &acpi_pci_roots); | 532 | list_add_tail(&root->node, &acpi_pci_roots); |
519 | mutex_unlock(&acpi_pci_root_lock); | 533 | mutex_unlock(&acpi_pci_root_lock); |
520 | 534 | ||
521 | printk(KERN_INFO PREFIX "%s [%s] (domain %04x %pR)\n", | ||
522 | acpi_device_name(device), acpi_device_bid(device), | ||
523 | root->segment, &root->secondary); | ||
524 | |||
525 | /* | 535 | /* |
526 | * Scan the Root Bridge | 536 | * Scan the Root Bridge |
527 | * -------------------- | 537 | * -------------------- |
@@ -548,16 +558,6 @@ static int __devinit acpi_pci_root_add(struct acpi_device *device) | |||
548 | goto out_del_root; | 558 | goto out_del_root; |
549 | 559 | ||
550 | /* | 560 | /* |
551 | * PCI Routing Table | ||
552 | * ----------------- | ||
553 | * Evaluate and parse _PRT, if exists. | ||
554 | */ | ||
555 | status = acpi_get_handle(device->handle, METHOD_NAME__PRT, &handle); | ||
556 | if (ACPI_SUCCESS(status)) | ||
557 | result = acpi_pci_irq_add_prt(device->handle, root->segment, | ||
558 | root->secondary.start); | ||
559 | |||
560 | /* | ||
561 | * Scan and bind all _ADR-Based Devices | 561 | * Scan and bind all _ADR-Based Devices |
562 | */ | 562 | */ |
563 | list_for_each_entry(child, &device->children, node) | 563 | list_for_each_entry(child, &device->children, node) |
@@ -635,6 +635,8 @@ out_del_root: | |||
635 | mutex_lock(&acpi_pci_root_lock); | 635 | mutex_lock(&acpi_pci_root_lock); |
636 | list_del(&root->node); | 636 | list_del(&root->node); |
637 | mutex_unlock(&acpi_pci_root_lock); | 637 | mutex_unlock(&acpi_pci_root_lock); |
638 | |||
639 | acpi_pci_irq_del_prt(root->segment, root->secondary.start); | ||
638 | end: | 640 | end: |
639 | kfree(root); | 641 | kfree(root); |
640 | return result; | 642 | return result; |