Commit b1754a69 authored by Russell King (Oracle)'s avatar Russell King (Oracle) Committed by Jakub Kicinski
Browse files

net: phylink: fix regression when binding a PHY



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: default avatarJiawen Wu <jiawenwu@trustnetic.com>
Tested-by: default avatarJiawen Wu <jiawenwu@trustnetic.com>
Signed-off-by: default avatarRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Reviewed-by: default avatarSimon Horman <horms@kernel.org>
Link: https://patch.msgid.link/E1tZp1a-001V62-DT@rmk-PC.armlinux.org.uk


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent d73a4602
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -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,