lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aNu2xxrOuFuFc7wE@shell.armlinux.org.uk>
Date: Tue, 30 Sep 2025 11:53:59 +0100
From: "Russell King (Oracle)" <linux@...linux.org.uk>
To: Gatien CHEVALLIER <gatien.chevallier@...s.st.com>
Cc: Andrew Lunn <andrew@...n.ch>, Heiner Kallweit <hkallweit1@...il.com>,
	Florian Fainelli <florian.fainelli@...adcom.com>,
	Alexandre Torgue <alexandre.torgue@...s.st.com>,
	Andrew Lunn <andrew+netdev@...n.ch>,
	Christophe Roullier <christophe.roullier@...s.st.com>,
	Conor Dooley <conor+dt@...nel.org>,
	"David S. Miller" <davem@...emloft.net>, devicetree@...r.kernel.org,
	Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>,
	Krzysztof Kozlowski <krzk+dt@...nel.org>,
	linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
	linux-stm32@...md-mailman.stormreply.com,
	Maxime Coquelin <mcoquelin.stm32@...il.com>, netdev@...r.kernel.org,
	Paolo Abeni <pabeni@...hat.com>, Rob Herring <robh@...nel.org>,
	Simon Horman <horms@...nel.org>,
	Tristram Ha <Tristram.Ha@...rochip.com>
Subject: Re: [PATCH RFC net-next 2/6] net: phy: add phy_may_wakeup()

On Tue, Sep 30, 2025 at 11:04:28AM +0200, Gatien CHEVALLIER wrote:
> Hi Russell,
> 
> First of all, thank you for taking the time to propose something.
> 
> IIUC, using ethtool to enable WoL with, e.g: "ethtool -s end0 wol g"
> even if the WoL isn't really supported will prevent the phy suspend.

This is correct - whenever a PHY has WoL enabled, it won't be suspended
as it has to listen for the configured wake-up packet(s).

> Therefore, PHY drivers should be adapted to implement something like:
> 
> 	if (!device_can_wakeup(&dev->mdio.dev))
> 		return -EOPNOTSUPP;
> 
> in their set_wol() ops to fully adapt to what you propose, right?

That's not sufficient. Yes, it's one of the things they need to do.

1. get_wol() should set ->supported to 0 (or at least not add anything
   to it) if wake-up is not possible.

2. set_wol() should not enable WoL modes or return -EOPNOTSUPP as you
   have above if wake-up is not possible. It should also call
   device_set_wakeup_enable() to indicate whether wake-up has been
   enabled for this device or not.

3. the PHY driver's probe function needs to be modified to call 
   device_set_wakeup_capable() to configure whether this device _really_
   can wake-up the system. See realtek_main.c::rtl8211f_probe() and
   broadcom.c as examples.

4. if using interrupt-based wake-up, use devm_pm_set_wake_irq() so
   the driver core can manage the irq-wake configuration.

See realtek_main.c - that's the driver I recently fixed (it had many
issues).

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ