netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: Gatien CHEVALLIER <gatien.chevallier@foss.st.com>
Cc: Andrew Lunn <andrew@lunn.ch>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	Florian Fainelli <florian.fainelli@broadcom.com>,
	Alexandre Torgue <alexandre.torgue@foss.st.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	Christophe Roullier <christophe.roullier@foss.st.com>,
	Conor Dooley <conor+dt@kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	devicetree@vger.kernel.org, Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	linux-stm32@st-md-mailman.stormreply.com,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	netdev@vger.kernel.org, Paolo Abeni <pabeni@redhat.com>,
	Rob Herring <robh@kernel.org>, Simon Horman <horms@kernel.org>,
	Tristram Ha <Tristram.Ha@microchip.com>
Subject: Re: [PATCH RFC net-next 2/6] net: phy: add phy_may_wakeup()
Date: Tue, 30 Sep 2025 11:53:59 +0100	[thread overview]
Message-ID: <aNu2xxrOuFuFc7wE@shell.armlinux.org.uk> (raw)
In-Reply-To: <2e23535f-f0a2-4111-ae64-6f496a72f27d@foss.st.com>

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!

  reply	other threads:[~2025-09-30 10:54 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-28  8:55 [PATCH RFC net-next 0/6] net: add phylink managed WoL and convert stmmac Russell King (Oracle)
2025-09-28  8:58 ` [PATCH RFC net-next 1/6] net: phy: add phy_can_wakeup() Russell King (Oracle)
2025-09-28  8:58 ` [PATCH RFC net-next 2/6] net: phy: add phy_may_wakeup() Russell King (Oracle)
2025-09-30  9:04   ` Gatien CHEVALLIER
2025-09-30 10:53     ` Russell King (Oracle) [this message]
2025-09-28  8:59 ` [PATCH RFC net-next 3/6] net: phylink: add phylink managed MAC Wake-on-Lan support Russell King (Oracle)
2025-09-28  9:32   ` Russell King (Oracle)
2025-09-28  8:59 ` [PATCH RFC net-next 4/6] net: phylink: add phylink managed wake-on-lan PHY speed control Russell King (Oracle)
2025-09-28  8:59 ` [PATCH RFC net-next 5/6] net: stmmac: convert to phylink-managed Wake-on-Lan Russell King (Oracle)
2025-09-28  8:59 ` [PATCH RFC net-next 6/6] net: stmmac: convert to phylink managed WoL PHY speed Russell King (Oracle)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aNu2xxrOuFuFc7wE@shell.armlinux.org.uk \
    --to=linux@armlinux.org.uk \
    --cc=Tristram.Ha@microchip.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=andrew@lunn.ch \
    --cc=christophe.roullier@foss.st.com \
    --cc=conor+dt@kernel.org \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=edumazet@google.com \
    --cc=florian.fainelli@broadcom.com \
    --cc=gatien.chevallier@foss.st.com \
    --cc=hkallweit1@gmail.com \
    --cc=horms@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=robh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).