These changes are the raw update to linux-4.4.6-rt14. Kernel sources
[kvmfornfv.git] / kernel / drivers / net / ethernet / sfc / selftest.c
index b605dfd..9d78830 100644 (file)
@@ -114,7 +114,10 @@ static int efx_test_nvram(struct efx_nic *efx, struct efx_self_tests *tests)
 
        if (efx->type->test_nvram) {
                rc = efx->type->test_nvram(efx);
-               tests->nvram = rc ? -1 : 1;
+               if (rc == -EPERM)
+                       rc = 0;
+               else
+                       tests->nvram = rc ? -1 : 1;
        }
 
        return rc;
@@ -253,6 +256,12 @@ static int efx_test_phy(struct efx_nic *efx, struct efx_self_tests *tests,
        mutex_lock(&efx->mac_lock);
        rc = efx->phy_op->run_tests(efx, tests->phy_ext, flags);
        mutex_unlock(&efx->mac_lock);
+       if (rc == -EPERM)
+               rc = 0;
+       else
+               netif_info(efx, drv, efx->net_dev,
+                          "%s phy selftest\n", rc ? "Failed" : "Passed");
+
        return rc;
 }
 
@@ -661,6 +670,9 @@ static int efx_test_loopbacks(struct efx_nic *efx, struct efx_self_tests *tests,
        wmb();
        kfree(state);
 
+       if (rc == -EPERM)
+               rc = 0;
+
        return rc;
 }