powerpc/eeh: Don't remove passed VFs
authorGavin Shan <gwshan@linux.vnet.ibm.com>
Thu, 3 Mar 2016 23:53:13 +0000 (10:53 +1100)
committerMichael Ellerman <mpe@ellerman.id.au>
Tue, 8 Mar 2016 22:58:27 +0000 (09:58 +1100)
When we have partial hotplug as part of the error recovery on PF,
the VFs that are bound with vfio-pci driver will experience hotplug.
That's not allowed.

This checks if the VF PE is passed or not. If it does, we leave
the VF without removing it.

Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Reviewed-by: Russell Currey <ruscur@russell.cc>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/kernel/eeh_driver.c

index 6c59de8b928066f580748fb8b0c4c2c4e5a3e81d..fb6207d2c604b4bd9b24d35c57454c080383775a 100644 (file)
@@ -454,6 +454,9 @@ static void *eeh_rmv_device(void *data, void *userdata)
        driver = eeh_pcid_get(dev);
        if (driver) {
                eeh_pcid_put(dev);
+               if (removed &&
+                   eeh_pe_passed(edev->pe))
+                       return NULL;
                if (removed &&
                    driver->err_handler &&
                    driver->err_handler->error_detected &&