]> www.infradead.org Git - users/hch/misc.git/commitdiff
net: phylink: fix regression when binding a PHY
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Mon, 20 Jan 2025 10:28:54 +0000 (10:28 +0000)
committerJakub Kicinski <kuba@kernel.org>
Tue, 21 Jan 2025 00:32:42 +0000 (16:32 -0800)
Some PHYs don't support clause 45 access, and return -EOPNOTSUPP from
phy_modify_mmd(), which causes phylink_bringup_phy() to fail. Prevent
this failure by allowing -EOPNOTSUPP to also mean success.

Reported-by: Jiawen Wu <jiawenwu@trustnetic.com>
Tested-by: Jiawen Wu <jiawenwu@trustnetic.com>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/E1tZp1a-001V62-DT@rmk-PC.armlinux.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/phy/phylink.c

index d130634d3bc71a0d2355fd7e0889affe94e94ac1..214b62fba991ed04063fa35061b57b5522bf86b4 100644 (file)
@@ -2268,7 +2268,11 @@ static int phylink_bringup_phy(struct phylink *pl, struct phy_device *phy,
        /* Explicitly configure whether the PHY is allowed to stop it's
         * receive clock.
         */
-       return phy_eee_rx_clock_stop(phy, pl->config->eee_rx_clk_stop_enable);
+       ret = phy_eee_rx_clock_stop(phy, pl->config->eee_rx_clk_stop_enable);
+       if (ret == -EOPNOTSUPP)
+               ret = 0;
+
+       return ret;
 }
 
 static int phylink_attach_phy(struct phylink *pl, struct phy_device *phy,