linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] net: phylink: check for SFP bus presence in phylink_expects_phy
@ 2023-04-12  7:48 Maxime Chevallier
  2023-04-12  7:51 ` Russell King (Oracle)
  0 siblings, 1 reply; 3+ messages in thread
From: Maxime Chevallier @ 2023-04-12  7:48 UTC (permalink / raw)
  To: davem, Sit Michael Wei Hong, Giuseppe Cavallaro, Alexandre Torgue,
	Jose Abreu, Maxime Coquelin,
	linux-stm32 @ st-md-mailman . stormreply . com,
	alexis . lothore @ bootlin . com
  Cc: Maxime Chevallier, netdev, linux-kernel, thomas.petazzoni,
	Andrew Lunn, Jakub Kicinski, Eric Dumazet, Paolo Abeni,
	Florian Fainelli, Heiner Kallweit, Russell King, linux-arm-kernel

When an SFP bus is present, we don't expect a PHY to be attached
directly from the MAC driver, it will be handled by phylink at SFP
attach time.

Fixes: 653a180957a8 ("net: phylink: add phylink_expects_phy() method")
Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
---
This was tested on dwmac_socfpga, following discussion here [1]

[1] : https://lore.kernel.org/netdev/PH0PR11MB758766370DD16A5107B1FAB69D9B9@PH0PR11MB7587.namprd11.prod.outlook.com/

 drivers/net/phy/phylink.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c
index a4111f1be375..334018f1028d 100644
--- a/drivers/net/phy/phylink.c
+++ b/drivers/net/phy/phylink.c
@@ -1594,7 +1594,8 @@ EXPORT_SYMBOL_GPL(phylink_destroy);
  */
 bool phylink_expects_phy(struct phylink *pl)
 {
-	if (pl->cfg_link_an_mode == MLO_AN_FIXED ||
+	if (pl->sfp_bus ||
+	    pl->cfg_link_an_mode == MLO_AN_FIXED ||
 	    (pl->cfg_link_an_mode == MLO_AN_INBAND &&
 	     phy_interface_mode_is_8023z(pl->link_config.interface)))
 		return false;
-- 
2.39.2


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2023-04-12  8:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-12  7:48 [PATCH net] net: phylink: check for SFP bus presence in phylink_expects_phy Maxime Chevallier
2023-04-12  7:51 ` Russell King (Oracle)
2023-04-12  8:06   ` Maxime Chevallier

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).