Re: [PATCH net 1/2] net: stmmac: propagate platform mac_finish errors
From: Thomas Karpiniec
Date: Thu Sep 17 2026 - 00:12:24 EST
On 16/09/2026 10:03 pm, Mohd Ayaan Anwar wrote:
On Wed, Sep 16, 2026 at 08:39:49PM +1000, Thomas Karpiniec wrote:No, I haven't seen that error or any specific SerDes faults. The error message you mention appears to be a failure in the serdes_powerup callback whereas this is propagating errors from mac_finish.
From: Thomas Karpiniec <tom@xxxxxxxx>
stmmac_mac_finish() discards the platform callback's return value and
always reports success to phylink. For example, the Qualcomm ETHQOS
callback can return an error from phy_set_mode_ext() if SerDes
configuration fails. Phylink then treats the interface as successfully
configured and can report carrier even though the SerDes is not ready.
Return the platform callback's result so that phylink can report the
failure and keep the link down until a subsequent configuration succeeds.
Keep returning zero when no platform callback is installed.
Fixes: e654cfc718d4 ("net: stmmac: configure SerDes on mac_finish")
Cc: stable@xxxxxxxxxxxxxxx
Assisted-by: LLM sparse
Signed-off-by: Thomas Karpiniec <tom@xxxxxxxx>
---
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 1fb5f804ea23..1350e92943ac 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -1048,8 +1048,8 @@ static int stmmac_mac_finish(struct phylink_config *config, unsigned int mode,
struct stmmac_priv *priv = netdev_priv(ndev);
if (priv->plat->mac_finish)
- priv->plat->mac_finish(ndev, priv->plat->bsp_priv, mode,
- interface);
+ return priv->plat->mac_finish(ndev, priv->plat->bsp_priv, mode,
+ interface);
return 0;
}
Just curious, are you trying to resolve the issue where an interface
gets created depite:
qcom-dwmac-sgmii-phy 8909000.phy: QSERDES_COM_C_READY_STATUS timed-out
qcom-ethqos 23040000.ethernet eth0: __stmmac_open: Serdes powerup failed
in dmesg?
I just happened to notice the discarded return value while working in the area so I don't think it's related.
Tom