net: sh_eth: Disable WoL if system can not suspend
Subsystems (3)
The MAC can't facilitate WoL if the system can't go to sleep. Gate the WoL support callbacks in ethtool at compile time using CONFIG_PM_SLEEP.
---
Hi,
Recent rework of the PM suspend operations by Geert revealed that the WoL setup code was gated behind CONFIG_PM_SLEEP, but that the driver still broadcaster support for it.
With the PM suspend operations improved by Geert this just fixes up the WoL support showed thru ethtool. A system now compiled without CONFIG_PM_SLEEP gives.
# ethtool -s eth0 wol g
netlink error: Operation not supported
---
drivers/net/ethernet/renesas/sh_eth.c | 4 ++++
1 file changed, 4 insertions(+)drivers/net/ethernet/renesas/sh_eth.c +4 -0
@@ -2360,6 +2360,7 @@ static int sh_eth_set_ringparam(struct net_device *ndev,return 0 ; } +#ifdef CONFIG_PM_SLEEP static void sh_eth_get_wol (struct net_device *ndev,struct ethtool_wolinfo *wol) {struct sh_eth_private *mdp =netdev_priv (ndev);
@@ -2386,6 +2387,7 @@ static int sh_eth_set_wol(struct net_device *ndev, struct ethtool_wolinfo *wol)return 0 ; } +#endif static const struct ethtool_ops sh_eth_ethtool_ops = { .get_regs_len = sh_eth_get_regs_len,
@@ -2401,8 +2403,10 @@ static const struct ethtool_ops sh_eth_ethtool_ops = { .set_ringparam = sh_eth_set_ringparam, .get_link_ksettings = phy_ethtool_get_link_ksettings, .set_link_ksettings = phy_ethtool_set_link_ksettings, +#ifdef CONFIG_PM_SLEEP .get_wol = sh_eth_get_wol, .set_wol = sh_eth_set_wol, +#endif };/* network device open function */
Signature · 1 line
2.51.0
Andrew Lunn
Reviewed-byQuoted 4 lines · Niklas Söderlund
The MAC can't facilitate WoL if the system can't go to sleep. Gate the WoL support callbacks in ethtool at compile time using
CONFIG_PM_SLEEP.Signed-off-by Niklas Söderlund <[email protected]>
Thanks for doing this.
Andrew
Geert Uytterhoeven
Reviewed-byQuoted 4 lines · Niklas Söderlund
The MAC can't facilitate WoL if the system can't go to sleep. Gate the WoL support callbacks in ethtool at compile time using
CONFIG_PM_SLEEP.Signed-off-by Niklas Söderlund <[email protected]>
Gr{oetje,eeting}s,
Geert
Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected] In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Quoted 8 lines · On Tue, 9 Sep 2025 10:58:49 +0200 you wrote:
The MAC can't facilitate WoL if the system can't go to sleep. Gate the WoL support callbacks in ethtool at compile time using
CONFIG_PM_SLEEP.Signed-off-by Niklas Söderlund <[email protected]>---
Hi,[...]
Here is the summary with links:
- [net-next] net: sh_eth: Disable WoL if system can not suspend
https://git.kernel.org/netdev/net-next/c/9c02ea544ac3
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html