diff options
Diffstat (limited to 'drivers/acpi/pci_root.c')
-rw-r--r-- | drivers/acpi/pci_root.c | 67 |
1 files changed, 12 insertions, 55 deletions
diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c index dcbe9660e756..471b2dcb1c67 100644 --- a/drivers/acpi/pci_root.c +++ b/drivers/acpi/pci_root.c | |||
@@ -47,7 +47,6 @@ ACPI_MODULE_NAME("pci_root"); | |||
47 | #define ACPI_PCI_ROOT_DEVICE_NAME "PCI Root Bridge" | 47 | #define ACPI_PCI_ROOT_DEVICE_NAME "PCI Root Bridge" |
48 | static int acpi_pci_root_add(struct acpi_device *device); | 48 | static int acpi_pci_root_add(struct acpi_device *device); |
49 | static int acpi_pci_root_remove(struct acpi_device *device, int type); | 49 | static int acpi_pci_root_remove(struct acpi_device *device, int type); |
50 | static int acpi_pci_root_start(struct acpi_device *device); | ||
51 | 50 | ||
52 | #define ACPI_PCIE_REQ_SUPPORT (OSC_EXT_PCI_CONFIG_SUPPORT \ | 51 | #define ACPI_PCIE_REQ_SUPPORT (OSC_EXT_PCI_CONFIG_SUPPORT \ |
53 | | OSC_ACTIVE_STATE_PWR_SUPPORT \ | 52 | | OSC_ACTIVE_STATE_PWR_SUPPORT \ |
@@ -67,7 +66,6 @@ static struct acpi_driver acpi_pci_root_driver = { | |||
67 | .ops = { | 66 | .ops = { |
68 | .add = acpi_pci_root_add, | 67 | .add = acpi_pci_root_add, |
69 | .remove = acpi_pci_root_remove, | 68 | .remove = acpi_pci_root_remove, |
70 | .start = acpi_pci_root_start, | ||
71 | }, | 69 | }, |
72 | }; | 70 | }; |
73 | 71 | ||
@@ -188,21 +186,6 @@ static acpi_status try_get_root_bridge_busnr(acpi_handle handle, | |||
188 | return AE_OK; | 186 | return AE_OK; |
189 | } | 187 | } |
190 | 188 | ||
191 | static void acpi_pci_bridge_scan(struct acpi_device *device) | ||
192 | { | ||
193 | int status; | ||
194 | struct acpi_device *child = NULL; | ||
195 | |||
196 | if (device->flags.bus_address) | ||
197 | if (device->parent && device->parent->ops.bind) { | ||
198 | status = device->parent->ops.bind(device); | ||
199 | if (!status) { | ||
200 | list_for_each_entry(child, &device->children, node) | ||
201 | acpi_pci_bridge_scan(child); | ||
202 | } | ||
203 | } | ||
204 | } | ||
205 | |||
206 | static u8 pci_osc_uuid_str[] = "33DB4D5B-1FF7-401C-9657-7441C03DD766"; | 189 | static u8 pci_osc_uuid_str[] = "33DB4D5B-1FF7-401C-9657-7441C03DD766"; |
207 | 190 | ||
208 | static acpi_status acpi_pci_run_osc(acpi_handle handle, | 191 | static acpi_status acpi_pci_run_osc(acpi_handle handle, |
@@ -452,7 +435,7 @@ static int acpi_pci_root_add(struct acpi_device *device) | |||
452 | int result; | 435 | int result; |
453 | struct acpi_pci_root *root; | 436 | struct acpi_pci_root *root; |
454 | acpi_handle handle; | 437 | acpi_handle handle; |
455 | struct acpi_device *child; | 438 | struct acpi_pci_driver *driver; |
456 | u32 flags, base_flags; | 439 | u32 flags, base_flags; |
457 | bool is_osc_granted = false; | 440 | bool is_osc_granted = false; |
458 | 441 | ||
@@ -603,21 +586,6 @@ static int acpi_pci_root_add(struct acpi_device *device) | |||
603 | goto out_del_root; | 586 | goto out_del_root; |
604 | } | 587 | } |
605 | 588 | ||
606 | /* | ||
607 | * Attach ACPI-PCI Context | ||
608 | * ----------------------- | ||
609 | * Thus binding the ACPI and PCI devices. | ||
610 | */ | ||
611 | result = acpi_pci_bind_root(device); | ||
612 | if (result) | ||
613 | goto out_del_root; | ||
614 | |||
615 | /* | ||
616 | * Scan and bind all _ADR-Based Devices | ||
617 | */ | ||
618 | list_for_each_entry(child, &device->children, node) | ||
619 | acpi_pci_bridge_scan(child); | ||
620 | |||
621 | /* ASPM setting */ | 589 | /* ASPM setting */ |
622 | if (is_osc_granted) { | 590 | if (is_osc_granted) { |
623 | if (acpi_gbl_FADT.boot_flags & ACPI_FADT_NO_ASPM) | 591 | if (acpi_gbl_FADT.boot_flags & ACPI_FADT_NO_ASPM) |
@@ -632,24 +600,6 @@ static int acpi_pci_root_add(struct acpi_device *device) | |||
632 | if (device->wakeup.flags.run_wake) | 600 | if (device->wakeup.flags.run_wake) |
633 | device_set_run_wake(root->bus->bridge, true); | 601 | device_set_run_wake(root->bus->bridge, true); |
634 | 602 | ||
635 | return 0; | ||
636 | |||
637 | out_del_root: | ||
638 | mutex_lock(&acpi_pci_root_lock); | ||
639 | list_del(&root->node); | ||
640 | mutex_unlock(&acpi_pci_root_lock); | ||
641 | |||
642 | acpi_pci_irq_del_prt(root->segment, root->secondary.start); | ||
643 | end: | ||
644 | kfree(root); | ||
645 | return result; | ||
646 | } | ||
647 | |||
648 | static int acpi_pci_root_start(struct acpi_device *device) | ||
649 | { | ||
650 | struct acpi_pci_root *root = acpi_driver_data(device); | ||
651 | struct acpi_pci_driver *driver; | ||
652 | |||
653 | if (system_state != SYSTEM_BOOTING) { | 603 | if (system_state != SYSTEM_BOOTING) { |
654 | pcibios_resource_survey_bus(root->bus); | 604 | pcibios_resource_survey_bus(root->bus); |
655 | pci_assign_unassigned_bus_resources(root->bus); | 605 | pci_assign_unassigned_bus_resources(root->bus); |
@@ -666,8 +616,17 @@ static int acpi_pci_root_start(struct acpi_device *device) | |||
666 | pci_enable_bridges(root->bus); | 616 | pci_enable_bridges(root->bus); |
667 | 617 | ||
668 | pci_bus_add_devices(root->bus); | 618 | pci_bus_add_devices(root->bus); |
669 | |||
670 | return 0; | 619 | return 0; |
620 | |||
621 | out_del_root: | ||
622 | mutex_lock(&acpi_pci_root_lock); | ||
623 | list_del(&root->node); | ||
624 | mutex_unlock(&acpi_pci_root_lock); | ||
625 | |||
626 | acpi_pci_irq_del_prt(root->segment, root->secondary.start); | ||
627 | end: | ||
628 | kfree(root); | ||
629 | return result; | ||
671 | } | 630 | } |
672 | 631 | ||
673 | static int acpi_pci_root_remove(struct acpi_device *device, int type) | 632 | static int acpi_pci_root_remove(struct acpi_device *device, int type) |
@@ -701,7 +660,7 @@ static int acpi_pci_root_remove(struct acpi_device *device, int type) | |||
701 | return 0; | 660 | return 0; |
702 | } | 661 | } |
703 | 662 | ||
704 | static int __init acpi_pci_root_init(void) | 663 | int __init acpi_pci_root_init(void) |
705 | { | 664 | { |
706 | acpi_hest_init(); | 665 | acpi_hest_init(); |
707 | 666 | ||
@@ -714,5 +673,3 @@ static int __init acpi_pci_root_init(void) | |||
714 | 673 | ||
715 | return 0; | 674 | return 0; |
716 | } | 675 | } |
717 | |||
718 | subsys_initcall(acpi_pci_root_init); | ||