aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-02-18 11:57:10 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-02-18 11:57:10 -0500
commit91219a3b20325689eb80f7598cce2dc745db171d (patch)
tree0d82f056a6b48e27a126556ac12204c84b728b02 /drivers/pci
parentaabaf4c2050d21d39fe11eec889c508e84d6a328 (diff)
parent6d0abeca3242a88cab8232e4acd7e2bf088f3bc2 (diff)
Merge 3.14-rc3 into driver-core-next
We want those fixes here for testing and development. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/pci')
-rw-r--r--drivers/pci/hotplug/acpiphp_glue.c15
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
733static 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)