aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/hotplug/acpiphp_glue.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pci/hotplug/acpiphp_glue.c')
-rw-r--r--drivers/pci/hotplug/acpiphp_glue.c30
1 files changed, 12 insertions, 18 deletions
diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c
index fce1c54a0c8d..9ddf69e3bbef 100644
--- a/drivers/pci/hotplug/acpiphp_glue.c
+++ b/drivers/pci/hotplug/acpiphp_glue.c
@@ -132,6 +132,18 @@ register_slot(acpi_handle handle, u32 lvl, void *context, void **rv)
132 if (!acpi_pci_check_ejectable(pbus, handle) && !is_dock_device(handle)) 132 if (!acpi_pci_check_ejectable(pbus, handle) && !is_dock_device(handle))
133 return AE_OK; 133 return AE_OK;
134 134
135 pdev = pbus->self;
136 if (pdev && pci_is_pcie(pdev)) {
137 tmp = acpi_find_root_bridge_handle(pdev);
138 if (tmp) {
139 struct acpi_pci_root *root = acpi_pci_find_root(tmp);
140
141 if (root && (root->osc_control_set &
142 OSC_PCI_EXPRESS_NATIVE_HP_CONTROL))
143 return AE_OK;
144 }
145 }
146
135 acpi_evaluate_integer(handle, "_ADR", NULL, &adr); 147 acpi_evaluate_integer(handle, "_ADR", NULL, &adr);
136 device = (adr >> 16) & 0xffff; 148 device = (adr >> 16) & 0xffff;
137 function = adr & 0xffff; 149 function = adr & 0xffff;
@@ -213,7 +225,6 @@ register_slot(acpi_handle handle, u32 lvl, void *context, void **rv)
213 225
214 pdev = pci_get_slot(pbus, PCI_DEVFN(device, function)); 226 pdev = pci_get_slot(pbus, PCI_DEVFN(device, function));
215 if (pdev) { 227 if (pdev) {
216 pdev->current_state = PCI_D0;
217 slot->flags |= (SLOT_ENABLED | SLOT_POWEREDON); 228 slot->flags |= (SLOT_ENABLED | SLOT_POWEREDON);
218 pci_dev_put(pdev); 229 pci_dev_put(pdev);
219 } 230 }
@@ -459,17 +470,8 @@ static int add_bridge(acpi_handle handle)
459{ 470{
460 acpi_status status; 471 acpi_status status;
461 unsigned long long tmp; 472 unsigned long long tmp;
462 struct acpi_pci_root *root;
463 acpi_handle dummy_handle; 473 acpi_handle dummy_handle;
464 474
465 /*
466 * We shouldn't use this bridge if PCIe native hotplug control has been
467 * granted by the BIOS for it.
468 */
469 root = acpi_pci_find_root(handle);
470 if (root && (root->osc_control_set & OSC_PCI_EXPRESS_NATIVE_HP_CONTROL))
471 return -ENODEV;
472
473 /* if the bridge doesn't have _STA, we assume it is always there */ 475 /* if the bridge doesn't have _STA, we assume it is always there */
474 status = acpi_get_handle(handle, "_STA", &dummy_handle); 476 status = acpi_get_handle(handle, "_STA", &dummy_handle);
475 if (ACPI_SUCCESS(status)) { 477 if (ACPI_SUCCESS(status)) {
@@ -1385,19 +1387,11 @@ static void handle_hotplug_event_func(acpi_handle handle, u32 type,
1385static acpi_status 1387static acpi_status
1386find_root_bridges(acpi_handle handle, u32 lvl, void *context, void **rv) 1388find_root_bridges(acpi_handle handle, u32 lvl, void *context, void **rv)
1387{ 1389{
1388 struct acpi_pci_root *root;
1389 int *count = (int *)context; 1390 int *count = (int *)context;
1390 1391
1391 if (!acpi_is_root_bridge(handle)) 1392 if (!acpi_is_root_bridge(handle))
1392 return AE_OK; 1393 return AE_OK;
1393 1394
1394 root = acpi_pci_find_root(handle);
1395 if (!root)
1396 return AE_OK;
1397
1398 if (root->osc_control_set & OSC_PCI_EXPRESS_NATIVE_HP_CONTROL)
1399 return AE_OK;
1400
1401 (*count)++; 1395 (*count)++;
1402 acpi_install_notify_handler(handle, ACPI_SYSTEM_NOTIFY, 1396 acpi_install_notify_handler(handle, ACPI_SYSTEM_NOTIFY,
1403 handle_hotplug_event_bridge, NULL); 1397 handle_hotplug_event_bridge, NULL);