diff options
| author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-02-18 12:09:09 -0500 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-02-18 12:09:09 -0500 |
| commit | 51d52b26e1d88ce79f1053f1b0f7f4d43a98d26d (patch) | |
| tree | fe0d213a91f49fd4340728a4f5bf34f60e3fba8c /drivers/pci | |
| parent | c600558668e4ebd0fab6bf1d90baaf95bc43f9d5 (diff) | |
| parent | 6d0abeca3242a88cab8232e4acd7e2bf088f3bc2 (diff) | |
Merge 3.14-rc3 into tty-next
This is for the fixes in that release, we want them here too.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/pci')
| -rw-r--r-- | drivers/pci/hotplug/acpiphp_glue.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c index e2a783fdb98f..7c7a388c85ab 100644 --- a/drivers/pci/hotplug/acpiphp_glue.c +++ b/drivers/pci/hotplug/acpiphp_glue.c | |||
| @@ -730,6 +730,17 @@ static unsigned int get_slot_status(struct acpiphp_slot *slot) | |||
| 730 | return (unsigned int)sta; | 730 | return (unsigned int)sta; |
| 731 | } | 731 | } |
| 732 | 732 | ||
| 733 | static inline bool device_status_valid(unsigned int sta) | ||
| 734 | { | ||
| 735 | /* | ||
| 736 | * ACPI spec says that _STA may return bit 0 clear with bit 3 set | ||
| 737 | * if the device is valid but does not require a device driver to be | ||
| 738 | * loaded (Section 6.3.7 of ACPI 5.0A). | ||
| 739 | */ | ||
| 740 | unsigned int mask = ACPI_STA_DEVICE_ENABLED | ACPI_STA_DEVICE_FUNCTIONING; | ||
| 741 | return (sta & mask) == mask; | ||
| 742 | } | ||
| 743 | |||
| 733 | /** | 744 | /** |
| 734 | * trim_stale_devices - remove PCI devices that are not responding. | 745 | * trim_stale_devices - remove PCI devices that are not responding. |
| 735 | * @dev: PCI device to start walking the hierarchy from. | 746 | * @dev: PCI device to start walking the hierarchy from. |
| @@ -745,7 +756,7 @@ static void trim_stale_devices(struct pci_dev *dev) | |||
| 745 | unsigned long long sta; | 756 | unsigned long long sta; |
| 746 | 757 | ||
| 747 | status = acpi_evaluate_integer(handle, "_STA", NULL, &sta); | 758 | status = acpi_evaluate_integer(handle, "_STA", NULL, &sta); |
| 748 | alive = (ACPI_SUCCESS(status) && sta == ACPI_STA_ALL) | 759 | alive = (ACPI_SUCCESS(status) && device_status_valid(sta)) |
| 749 | || acpiphp_no_hotplug(handle); | 760 | || acpiphp_no_hotplug(handle); |
| 750 | } | 761 | } |
| 751 | if (!alive) { | 762 | if (!alive) { |
| @@ -792,7 +803,7 @@ static void acpiphp_check_bridge(struct acpiphp_bridge *bridge) | |||
| 792 | mutex_lock(&slot->crit_sect); | 803 | mutex_lock(&slot->crit_sect); |
| 793 | if (slot_no_hotplug(slot)) { | 804 | if (slot_no_hotplug(slot)) { |
| 794 | ; /* do nothing */ | 805 | ; /* do nothing */ |
| 795 | } else if (get_slot_status(slot) == ACPI_STA_ALL) { | 806 | } else if (device_status_valid(get_slot_status(slot))) { |
| 796 | /* remove stale devices if any */ | 807 | /* remove stale devices if any */ |
| 797 | list_for_each_entry_safe_reverse(dev, tmp, | 808 | list_for_each_entry_safe_reverse(dev, tmp, |
| 798 | &bus->devices, bus_list) | 809 | &bus->devices, bus_list) |
