common/sfc_efx/base: fix PHY config failure on Riverhead
authorAndrew Rybchenko <arybchenko@solarflare.com>
Tue, 13 Oct 2020 13:45:22 +0000 (14:45 +0100)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 16 Oct 2020 17:48:17 +0000 (19:48 +0200)
Riverhead does not support LED control yet. It is perfectly
fine to ignore LED set failure because of no support if
configured LED mode is the default.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
drivers/common/sfc_efx/base/ef10_phy.c

index 3d07c25..74a1884 100644 (file)
@@ -530,8 +530,16 @@ ef10_phy_reconfigure(
 #endif
 
        rc = efx_mcdi_phy_set_led(enp, phy_led_mode);
-       if (rc != 0)
+       if (rc != 0) {
+               /*
+                * If LED control is not supported by firmware, we can
+                * silently ignore default mode set failure
+                * (see FWRIVERHD-198).
+                */
+               if (rc == EOPNOTSUPP && phy_led_mode == EFX_PHY_LED_DEFAULT)
+                       goto out;
                goto fail3;
+       }
 
 out:
        return (0);