diff options
Diffstat (limited to 'drivers/pci/hotplug/acpiphp_glue.c')
-rw-r--r-- | drivers/pci/hotplug/acpiphp_glue.c | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c index 596172b4ae95..fce1c54a0c8d 100644 --- a/drivers/pci/hotplug/acpiphp_glue.c +++ b/drivers/pci/hotplug/acpiphp_glue.c | |||
@@ -459,8 +459,17 @@ static int add_bridge(acpi_handle handle) | |||
459 | { | 459 | { |
460 | acpi_status status; | 460 | acpi_status status; |
461 | unsigned long long tmp; | 461 | unsigned long long tmp; |
462 | struct acpi_pci_root *root; | ||
462 | acpi_handle dummy_handle; | 463 | acpi_handle dummy_handle; |
463 | 464 | ||
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 | |||
464 | /* if the bridge doesn't have _STA, we assume it is always there */ | 473 | /* if the bridge doesn't have _STA, we assume it is always there */ |
465 | status = acpi_get_handle(handle, "_STA", &dummy_handle); | 474 | status = acpi_get_handle(handle, "_STA", &dummy_handle); |
466 | if (ACPI_SUCCESS(status)) { | 475 | if (ACPI_SUCCESS(status)) { |
@@ -1376,13 +1385,23 @@ static void handle_hotplug_event_func(acpi_handle handle, u32 type, | |||
1376 | static acpi_status | 1385 | static acpi_status |
1377 | find_root_bridges(acpi_handle handle, u32 lvl, void *context, void **rv) | 1386 | find_root_bridges(acpi_handle handle, u32 lvl, void *context, void **rv) |
1378 | { | 1387 | { |
1388 | struct acpi_pci_root *root; | ||
1379 | int *count = (int *)context; | 1389 | int *count = (int *)context; |
1380 | 1390 | ||
1381 | if (acpi_is_root_bridge(handle)) { | 1391 | if (!acpi_is_root_bridge(handle)) |
1382 | acpi_install_notify_handler(handle, ACPI_SYSTEM_NOTIFY, | 1392 | return AE_OK; |
1383 | handle_hotplug_event_bridge, NULL); | 1393 | |
1384 | (*count)++; | 1394 | root = acpi_pci_find_root(handle); |
1385 | } | 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)++; | ||
1402 | acpi_install_notify_handler(handle, ACPI_SYSTEM_NOTIFY, | ||
1403 | handle_hotplug_event_bridge, NULL); | ||
1404 | |||
1386 | return AE_OK ; | 1405 | return AE_OK ; |
1387 | } | 1406 | } |
1388 | 1407 | ||