|
@@ -541,6 +541,7 @@ static unsigned int get_slot_status(struct acpiphp_slot *slot)
|
|
{
|
|
{
|
|
unsigned long long sta = 0;
|
|
unsigned long long sta = 0;
|
|
struct acpiphp_func *func;
|
|
struct acpiphp_func *func;
|
|
|
|
+ u32 dvid;
|
|
|
|
|
|
list_for_each_entry(func, &slot->funcs, sibling) {
|
|
list_for_each_entry(func, &slot->funcs, sibling) {
|
|
if (func->flags & FUNC_HAS_STA) {
|
|
if (func->flags & FUNC_HAS_STA) {
|
|
@@ -551,19 +552,27 @@ static unsigned int get_slot_status(struct acpiphp_slot *slot)
|
|
if (ACPI_SUCCESS(status) && sta)
|
|
if (ACPI_SUCCESS(status) && sta)
|
|
break;
|
|
break;
|
|
} else {
|
|
} else {
|
|
- u32 dvid;
|
|
|
|
-
|
|
|
|
- pci_bus_read_config_dword(slot->bus,
|
|
|
|
- PCI_DEVFN(slot->device,
|
|
|
|
- func->function),
|
|
|
|
- PCI_VENDOR_ID, &dvid);
|
|
|
|
- if (dvid != 0xffffffff) {
|
|
|
|
|
|
+ if (pci_bus_read_dev_vendor_id(slot->bus,
|
|
|
|
+ PCI_DEVFN(slot->device, func->function),
|
|
|
|
+ &dvid, 0)) {
|
|
sta = ACPI_STA_ALL;
|
|
sta = ACPI_STA_ALL;
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if (!sta) {
|
|
|
|
+ /*
|
|
|
|
+ * Check for the slot itself since it may be that the
|
|
|
|
+ * ACPI slot is a device below PCIe upstream port so in
|
|
|
|
+ * that case it may not even be reachable yet.
|
|
|
|
+ */
|
|
|
|
+ if (pci_bus_read_dev_vendor_id(slot->bus,
|
|
|
|
+ PCI_DEVFN(slot->device, 0), &dvid, 0)) {
|
|
|
|
+ sta = ACPI_STA_ALL;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
return (unsigned int)sta;
|
|
return (unsigned int)sta;
|
|
}
|
|
}
|
|
|
|
|