diff mbox series

[net] net: phylink: make configuring clock-stop dependent on MAC support

Message ID E1tgjNn-003q0w-Pw@rmk-PC.armlinux.org.uk (mailing list archive)
State Accepted
Commit 1942b1c6f687b9d1efc93f35239f185a84900e93
Delegated to: Netdev Maintainers
Headers show
Series [net] net: phylink: make configuring clock-stop dependent on MAC support | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag present in non-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 9 of 9 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 Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 21 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-02-11--00-00 (tests: 889)

Commit Message

Russell King (Oracle) Feb. 8, 2025, 11:52 a.m. UTC
We should not be configuring the PHYs clock-stop settings unless the
MAC supports phylink managed EEE. Make this dependent on MAC support.

This was noticed in a suspicious RCU usage report from the kernel
test robot (the suspicious RCU usage due to calling phy_detach()
remains unaddressed, but is triggered by the error this was
generating.)

Fixes: 03abf2a7c654 ("net: phylink: add EEE management")
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
---
 drivers/net/phy/phylink.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

Comments

Andrew Lunn Feb. 10, 2025, 12:32 a.m. UTC | #1
On Sat, Feb 08, 2025 at 11:52:23AM +0000, Russell King (Oracle) wrote:
> We should not be configuring the PHYs clock-stop settings unless the
> MAC supports phylink managed EEE. Make this dependent on MAC support.
> 
> This was noticed in a suspicious RCU usage report from the kernel
> test robot (the suspicious RCU usage due to calling phy_detach()
> remains unaddressed, but is triggered by the error this was
> generating.)
> 
> Fixes: 03abf2a7c654 ("net: phylink: add EEE management")
> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>

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

    Andrew
patchwork-bot+netdevbpf@kernel.org Feb. 12, 2025, 12:40 a.m. UTC | #2
Hello:

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

On Sat, 08 Feb 2025 11:52:23 +0000 you wrote:
> We should not be configuring the PHYs clock-stop settings unless the
> MAC supports phylink managed EEE. Make this dependent on MAC support.
> 
> This was noticed in a suspicious RCU usage report from the kernel
> test robot (the suspicious RCU usage due to calling phy_detach()
> remains unaddressed, but is triggered by the error this was
> generating.)
> 
> [...]

Here is the summary with links:
  - [net] net: phylink: make configuring clock-stop dependent on MAC support
    https://git.kernel.org/netdev/net/c/1942b1c6f687

You are awesome, thank you!
diff mbox series

Patch

diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c
index 214b62fba991..b00a315de060 100644
--- a/drivers/net/phy/phylink.c
+++ b/drivers/net/phy/phylink.c
@@ -2265,12 +2265,15 @@  static int phylink_bringup_phy(struct phylink *pl, struct phy_device *phy,
 	/* Allow the MAC to stop its clock if the PHY has the capability */
 	pl->mac_tx_clk_stop = phy_eee_tx_clock_stop_capable(phy) > 0;
 
-	/* Explicitly configure whether the PHY is allowed to stop it's
-	 * receive clock.
-	 */
-	ret = phy_eee_rx_clock_stop(phy, pl->config->eee_rx_clk_stop_enable);
-	if (ret == -EOPNOTSUPP)
-		ret = 0;
+	if (pl->mac_supports_eee_ops) {
+		/* Explicitly configure whether the PHY is allowed to stop it's
+		 * receive clock.
+		 */
+		ret = phy_eee_rx_clock_stop(phy,
+					    pl->config->eee_rx_clk_stop_enable);
+		if (ret == -EOPNOTSUPP)
+			ret = 0;
+	}
 
 	return ret;
 }