Re: [PATCH net-next 2/3] sh_eth: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
Geert Uytterhoeven <[email protected]>
| Newsgroups | gmane.linux.kernel.renesas-soc,gmane.linux.network,gmane.linux.ports.sh.devel |
|---|---|
| Message-ID | <CAMuHMdW7+F-VdNw+LLCs_WPUsFVNnbsCT-wompswecEmipmhqA@mail.gmail.com> |
On Mon, 8 Sept 2025 at 16:36, Geert Uytterhoeven <[email protected]> wrote: > On Fri, 5 Sept 2025 at 20:41, Niklas Söderlund > <[email protected]> wrote: > > On 2025-09-05 13:57:05 +0200, Andrew Lunn wrote: > > > > You cannot enter system sleep without CONFIG_PM_SLEEP, so enabling > > > > WoL would be pointless. > > > > > > Yet get_wol will return WoL can be used, and set_wol will allow you to > > > configure it. It seems like EOPNOTSUPP would be better. > > > > Out of curiosity. Are you suggesting a compile time check/construct for > > CONFIG_PM_SLEEP be added in the driver itself, or in ethtool_set_wol() > > and ethtool_get_wol() in net/ethtool/ioctl.c to complement the > > > > if (!dev->ethtool_ops->get_wol || !dev->ethtool_ops->set_wol) > > return -EOPNOTSUPP; > > > > checks already there? To always return EOPNOTSUPP if PM_SLEEP is not > > selected? > > Iff we want to go that route, I'd vote for handling it in common code. > Still, there is no guarantee that WoL will actually work, as on > some systems it may depend on the firmware, too. E.g. on ARM > systems with PSCI, the SoC may be powered down during s2ram, so > there is no guarantee that any of the wake-up sources shown in > /sys/kernel/debug/wakeup_sources can actually wake up the system. > I tried having a mechanism to describe that in DT, but it was rejected. (oops, forgot to press "send" in an old draft) Discovering commit af8dbf9c6aa8972f ("schemas: wakeup-source: Possibility for system states") in dt-schema.git, there seems to be hope! Gr{oetje,eeting}s, Geert -- 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