Skip to content

Commit 1942b1c

Browse files
Russell King (Oracle)kuba-moo
authored andcommitted
net: phylink: make configuring clock-stop dependent on MAC support
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: 03abf2a ("net: phylink: add EEE management") Signed-off-by: Russell King (Oracle) <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 5805402 commit 1942b1c

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

drivers/net/phy/phylink.c

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2265,12 +2265,15 @@ static int phylink_bringup_phy(struct phylink *pl, struct phy_device *phy,
22652265
/* Allow the MAC to stop its clock if the PHY has the capability */
22662266
pl->mac_tx_clk_stop = phy_eee_tx_clock_stop_capable(phy) > 0;
22672267

2268-
/* Explicitly configure whether the PHY is allowed to stop it's
2269-
* receive clock.
2270-
*/
2271-
ret = phy_eee_rx_clock_stop(phy, pl->config->eee_rx_clk_stop_enable);
2272-
if (ret == -EOPNOTSUPP)
2273-
ret = 0;
2268+
if (pl->mac_supports_eee_ops) {
2269+
/* Explicitly configure whether the PHY is allowed to stop it's
2270+
* receive clock.
2271+
*/
2272+
ret = phy_eee_rx_clock_stop(phy,
2273+
pl->config->eee_rx_clk_stop_enable);
2274+
if (ret == -EOPNOTSUPP)
2275+
ret = 0;
2276+
}
22742277

22752278
return ret;
22762279
}

0 commit comments

Comments
 (0)