These changes are the raw update to linux-4.4.6-rt14. Kernel sources
[kvmfornfv.git] / kernel / drivers / pci / hotplug / acpiphp_glue.c
index bcb90e4..0b3e0bf 100644 (file)
@@ -632,15 +632,14 @@ static void trim_stale_devices(struct pci_dev *dev)
 {
        struct acpi_device *adev = ACPI_COMPANION(&dev->dev);
        struct pci_bus *bus = dev->subordinate;
-       bool alive = false;
+       bool alive = dev->ignore_hotplug;
 
        if (adev) {
                acpi_status status;
                unsigned long long sta;
 
                status = acpi_evaluate_integer(adev->handle, "_STA", NULL, &sta);
-               alive = (ACPI_SUCCESS(status) && device_status_valid(sta))
-                       || dev->ignore_hotplug;
+               alive = alive || (ACPI_SUCCESS(status) && device_status_valid(sta));
        }
        if (!alive)
                alive = pci_device_is_present(dev);
@@ -954,8 +953,10 @@ int acpiphp_enable_slot(struct acpiphp_slot *slot)
 {
        pci_lock_rescan_remove();
 
-       if (slot->flags & SLOT_IS_GOING_AWAY)
+       if (slot->flags & SLOT_IS_GOING_AWAY) {
+               pci_unlock_rescan_remove();
                return -ENODEV;
+       }
 
        /* configure all functions */
        if (!(slot->flags & SLOT_ENABLED))