[05/36] common/sfc_efx/base: fix PHY config failure on Riverhead

Message ID 1602596753-32282-6-git-send-email-arybchenko@solarflare.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series net/sfc: add EF100 support |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Andrew Rybchenko Oct. 13, 2020, 1:45 p.m. UTC
  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 | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
  

Patch

diff --git a/drivers/common/sfc_efx/base/ef10_phy.c b/drivers/common/sfc_efx/base/ef10_phy.c
index 3d07c254bf..74a18841d9 100644
--- a/drivers/common/sfc_efx/base/ef10_phy.c
+++ b/drivers/common/sfc_efx/base/ef10_phy.c
@@ -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);