netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: fec: fix probing of fec1 when fec0 is not probed yet
@ 2023-11-23 13:27 Heiko Schocher
  2023-11-23 15:11 ` Alexander Stein
  2023-11-23 20:09 ` Andrew Lunn
  0 siblings, 2 replies; 11+ messages in thread
From: Heiko Schocher @ 2023-11-23 13:27 UTC (permalink / raw)
  To: netdev
  Cc: Heiko Schocher, Clark Wang, David S. Miller, Eric Dumazet,
	Jakub Kicinski, NXP Linux Team, Paolo Abeni, Shenwei Wang,
	Wei Fang, linux-kernel

it is possible that fec1 is probed before fec0. On SoCs
with FEC_QUIRK_SINGLE_MDIO set (which means fec1 uses mii
from fec0) init of mii fails for fec1 when fec0 is not yet
probed, as fec0 setups mii bus. In this case fec_enet_mii_init
for fec1 returns with -ENODEV, and so fec1 never comes up.

Return here with -EPROBE_DEFER so interface gets later
probed again.

Found this on imx8qxp based board, using 2 ethernet interfaces,
and from time to time, fec1 interface came not up.

Signed-off-by: Heiko Schocher <hs@denx.de>
---

 drivers/net/ethernet/freescale/fec_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index c3b7694a7485..d956f95e7a65 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -2445,7 +2445,7 @@ static int fec_enet_mii_init(struct platform_device *pdev)
 			mii_cnt++;
 			return 0;
 		}
-		return -ENOENT;
+		return -EPROBE_DEFER;
 	}
 
 	bus_freq = 2500000; /* 2.5MHz by default */
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2023-11-29  2:34 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-23 13:27 [PATCH] net: fec: fix probing of fec1 when fec0 is not probed yet Heiko Schocher
2023-11-23 15:11 ` Alexander Stein
2023-11-23 15:26   ` Heiko Schocher
2023-11-23 15:42     ` Alexander Stein
2023-11-23 20:09 ` Andrew Lunn
2023-11-24  2:33   ` Wei Fang
2023-11-24  5:19     ` Heiko Schocher
2023-11-27  6:55       ` Wei Fang
2023-11-28  4:41         ` Heiko Schocher
2023-11-29  2:34           ` Wei Fang
2023-11-24  5:09   ` Heiko Schocher

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).