powerpc/eeh: Fix deadlock when PE frozen state can't be cleared
[firefly-linux-kernel-4.4.55.git] / arch / powerpc / kernel / eeh_driver.c
index c07bfb52275e27e307356cf58e48e0ed0db27c72..300382e5a2cc41978163449d33f6fdccf9613e6d 100644 (file)
@@ -612,8 +612,10 @@ static int eeh_reset_device(struct eeh_pe *pe, struct pci_bus *bus)
 
        /* Clear frozen state */
        rc = eeh_clear_pe_frozen_state(pe, false);
-       if (rc)
+       if (rc) {
+               pci_unlock_rescan_remove();
                return rc;
+       }
 
        /* Give the system 5 seconds to finish running the user-space
         * hotplug shutdown scripts, e.g. ifdown for ethernet.  Yes,