diff mbox series

[net-next] net: phylink: fix regression when binding a PHY

Message ID E1tZp1a-001V62-DT@rmk-PC.armlinux.org.uk (mailing list archive)
State Accepted
Commit b1754a69e7be48a64b3cdb0df60a96d97959da73
Delegated to: Netdev Maintainers
Headers show
Series [net-next] net: phylink: fix regression when binding a PHY | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 7 of 7 maintainers
netdev/build_clang success Errors and warnings before: 1 this patch: 1
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 12 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 18 this patch: 18
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2025-01-20--21-00 (tests: 887)

Commit Message

Russell King (Oracle) Jan. 20, 2025, 10:28 a.m. UTC
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>
---
 drivers/net/phy/phylink.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Comments

Simon Horman Jan. 20, 2025, 4:12 p.m. UTC | #1
On Mon, Jan 20, 2025 at 10:28:54AM +0000, Russell King (Oracle) wrote:
> 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>
patchwork-bot+netdevbpf@kernel.org Jan. 21, 2025, 12:40 a.m. UTC | #2
Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Mon, 20 Jan 2025 10:28:54 +0000 you wrote:
> 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>
> 
> [...]

Here is the summary with links:
  - [net-next] net: phylink: fix regression when binding a PHY
    https://git.kernel.org/netdev/net-next/c/b1754a69e7be

You are awesome, thank you!
diff mbox series

Patch

diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c
index 66eea3f963d3..56d411bb2547 100644
--- a/drivers/net/phy/phylink.c
+++ b/drivers/net/phy/phylink.c
@@ -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,