diff options
Diffstat (limited to 'drivers/pci/hotplug/acpiphp_glue.c')
-rw-r--r-- | drivers/pci/hotplug/acpiphp_glue.c | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c index 1cf605f67673..e86439283a5d 100644 --- a/drivers/pci/hotplug/acpiphp_glue.c +++ b/drivers/pci/hotplug/acpiphp_glue.c | |||
@@ -279,7 +279,9 @@ static acpi_status register_slot(acpi_handle handle, u32 lvl, void *data, | |||
279 | 279 | ||
280 | status = acpi_evaluate_integer(handle, "_ADR", NULL, &adr); | 280 | status = acpi_evaluate_integer(handle, "_ADR", NULL, &adr); |
281 | if (ACPI_FAILURE(status)) { | 281 | if (ACPI_FAILURE(status)) { |
282 | acpi_handle_warn(handle, "can't evaluate _ADR (%#x)\n", status); | 282 | if (status != AE_NOT_FOUND) |
283 | acpi_handle_warn(handle, | ||
284 | "can't evaluate _ADR (%#x)\n", status); | ||
283 | return AE_OK; | 285 | return AE_OK; |
284 | } | 286 | } |
285 | 287 | ||
@@ -643,6 +645,24 @@ static void disable_slot(struct acpiphp_slot *slot) | |||
643 | slot->flags &= (~SLOT_ENABLED); | 645 | slot->flags &= (~SLOT_ENABLED); |
644 | } | 646 | } |
645 | 647 | ||
648 | static bool acpiphp_no_hotplug(acpi_handle handle) | ||
649 | { | ||
650 | struct acpi_device *adev = NULL; | ||
651 | |||
652 | acpi_bus_get_device(handle, &adev); | ||
653 | return adev && adev->flags.no_hotplug; | ||
654 | } | ||
655 | |||
656 | static bool slot_no_hotplug(struct acpiphp_slot *slot) | ||
657 | { | ||
658 | struct acpiphp_func *func; | ||
659 | |||
660 | list_for_each_entry(func, &slot->funcs, sibling) | ||
661 | if (acpiphp_no_hotplug(func_to_handle(func))) | ||
662 | return true; | ||
663 | |||
664 | return false; | ||
665 | } | ||
646 | 666 | ||
647 | /** | 667 | /** |
648 | * get_slot_status - get ACPI slot status | 668 | * get_slot_status - get ACPI slot status |
@@ -701,7 +721,8 @@ static void trim_stale_devices(struct pci_dev *dev) | |||
701 | unsigned long long sta; | 721 | unsigned long long sta; |
702 | 722 | ||
703 | status = acpi_evaluate_integer(handle, "_STA", NULL, &sta); | 723 | status = acpi_evaluate_integer(handle, "_STA", NULL, &sta); |
704 | alive = ACPI_SUCCESS(status) && sta == ACPI_STA_ALL; | 724 | alive = (ACPI_SUCCESS(status) && sta == ACPI_STA_ALL) |
725 | || acpiphp_no_hotplug(handle); | ||
705 | } | 726 | } |
706 | if (!alive) { | 727 | if (!alive) { |
707 | u32 v; | 728 | u32 v; |
@@ -741,8 +762,9 @@ static void acpiphp_check_bridge(struct acpiphp_bridge *bridge) | |||
741 | struct pci_dev *dev, *tmp; | 762 | struct pci_dev *dev, *tmp; |
742 | 763 | ||
743 | mutex_lock(&slot->crit_sect); | 764 | mutex_lock(&slot->crit_sect); |
744 | /* wake up all functions */ | 765 | if (slot_no_hotplug(slot)) { |
745 | if (get_slot_status(slot) == ACPI_STA_ALL) { | 766 | ; /* do nothing */ |
767 | } else if (get_slot_status(slot) == ACPI_STA_ALL) { | ||
746 | /* remove stale devices if any */ | 768 | /* remove stale devices if any */ |
747 | list_for_each_entry_safe(dev, tmp, &bus->devices, | 769 | list_for_each_entry_safe(dev, tmp, &bus->devices, |
748 | bus_list) | 770 | bus_list) |