diff mbox series

[net-next,v5,3/7] net: stmmac: don't rely on lynx_pcs presence to check for a PHY

Message ID 20240301-rxc_bugfix-v5-3-8dac30230050@bootlin.com (mailing list archive)
State New, archived
Headers show
Series Fix missing PHY-to-MAC RX clock | expand

Commit Message

Romain Gantois March 1, 2024, 3:35 p.m. UTC
From: Maxime Chevallier <maxime.chevallier@bootlin.com>

When initializing attached PHYs, there are some cases where we don't expect
any PHY to be connected. The logic uses conditions based on various local
PCS configuration, but also calls-in phylink_expects_phy() via
stmmac_init_phy(), which is enough to ensure we don't try to initialize a
PHY when using a Lynx PCS, as long as we have the phy_interface set to a
802.3z mode and are using inband negociation.

Drop the lynx check, making the stmmac generic code more pcs_lynx-agnostic.

Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
[rgantois: commit log]
Signed-off-by: Romain Gantois <romain.gantois@bootlin.com>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Andrew Lunn March 4, 2024, 1:41 p.m. UTC | #1
On Fri, Mar 01, 2024 at 04:35:00PM +0100, Romain Gantois wrote:
> From: Maxime Chevallier <maxime.chevallier@bootlin.com>
> 
> When initializing attached PHYs, there are some cases where we don't expect
> any PHY to be connected. The logic uses conditions based on various local
> PCS configuration, but also calls-in phylink_expects_phy() via
> stmmac_init_phy(), which is enough to ensure we don't try to initialize a
> PHY when using a Lynx PCS, as long as we have the phy_interface set to a
> 802.3z mode and are using inband negociation.
> 
> Drop the lynx check, making the stmmac generic code more pcs_lynx-agnostic.
> 
> Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
> [rgantois: commit log]
> Signed-off-by: Romain Gantois <romain.gantois@bootlin.com>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew
diff mbox series

Patch

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 24cd80490d19..d78c625d33eb 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -3960,8 +3960,7 @@  static int __stmmac_open(struct net_device *dev,
 	if (priv->hw->pcs != STMMAC_PCS_TBI &&
 	    priv->hw->pcs != STMMAC_PCS_RTBI &&
 	    (!priv->hw->xpcs ||
-	     xpcs_get_an_mode(priv->hw->xpcs, mode) != DW_AN_C73) &&
-	    !priv->hw->lynx_pcs) {
+	     xpcs_get_an_mode(priv->hw->xpcs, mode) != DW_AN_C73)) {
 		ret = stmmac_init_phy(dev);
 		if (ret) {
 			netdev_err(priv->dev,