netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gatien CHEVALLIER <gatien.chevallier@foss.st.com>
To: Andrew Lunn <andrew@lunn.ch>,
	"Russell King (Oracle)" <rmk+kernel@armlinux.org.uk>
Cc: Heiner Kallweit <hkallweit1@gmail.com>,
	Daniel Braunwarth <daniel.braunwarth@kuka.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Florian Fainelli <florian.fainelli@broadcom.com>,
	Jakub Kicinski <kuba@kernel.org>,
	Jon Hunter <jonathanh@nvidia.com>, <netdev@vger.kernel.org>,
	Paolo Abeni <pabeni@redhat.com>,
	Thierry Reding <treding@nvidia.com>
Subject: Re: [PATCH RFC ???net???] net: phy: realtek: fix wake-on-lan support
Date: Wed, 30 Jul 2025 16:24:32 +0200	[thread overview]
Message-ID: <27e10ba4-5656-40a8-a709-c1390fee251f@foss.st.com> (raw)
In-Reply-To: <a14075fe-a0fc-4c59-b4d3-1060f6fd2676@lunn.ch>



On 7/30/25 15:59, Andrew Lunn wrote:
>> 2. detect whether we can support wake-up by having a valid interrupt,
>>     and the "wakeup-source" property in DT. If we can, then we mark
>>     the MDIO device as wakeup capable, and associate the interrupt
>>     with the wakeup source.
> 
> We should document "wakeup-source" in ethernet-phy.yaml.
> 

+1

> What are the different hardware architectures?
> 
> 1) A single interrupt line from the PHY to the SoC, which does both
> link status and WoL.
> 
> 2) The PHY has a dedicated WoL output pin, which is connected to an
> interrupt.
> 
> 3) The PHY has a dedicated WoL output pin, which is connected directly
> to a PMIC. No software involved, the pin toggling turns the power back
> on.
> 

Just my 2 cents:

In some cases like the LAN8742, there are some flags that need to be
cleared when waking up in order to be able to handle another WoL event.
It can be done either in the suspend()/resume() or in an interrupt
handler of the PHY. In 3) This suggests that the interrupt is somehow
forwarded to the Linux kernel.

This is what I was ultimately trying to do in two steps with the TEE
notifying the kernel of that interrupt.

Moreover, if a WoL event occurs when the system is not in a low-power
mode, then the flags will never be cleared and another WoL event cannot
be detected while the system is in a low-power mode.

Maybe we can argue that these flags can be cleared in suspend() and
and resume(). But then, if there's no interrupt to be handled by the
kernel, how do we know that we have woken up from a WoL event?

IMHO, I think 3) may optionally declare another interrupt as well
for WoL events.

Eventually, 2) and 3) would have 1 interrupt(WoL) if PHY is in polling
mode and 2 if not?

Please tell me if that makes any sense to you or if I missed something.

> For 1), i don't think 'wakeup-source' tells us anything useful. The
> driver just needs to check that interrupts are in use.
> 
> For 2) we should recommend that the wakeup interrupt is called
> "wakeup", following wakeup-source.txt, and the "wakeup-source"
> property is present.
> 
> For 3) its more magical, there is no interrupt properties involved, so
> we do need the "wakeup-source" to know that the pin is actually
> connected to something.
> 
> We need to differentiate between drivers newly getting WoL support,
> and existing drivers. We can be much more strict with new support.
> 
> 	Andrew

  parent reply	other threads:[~2025-07-30 14:27 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-30  8:35 [PATCH RFC ???net???] net: phy: realtek: fix wake-on-lan support Russell King (Oracle)
2025-07-30 13:59 ` Andrew Lunn
2025-07-30 14:22   ` Russell King (Oracle)
2025-07-30 14:35     ` Andrew Lunn
2025-07-30 15:49       ` Russell King (Oracle)
2025-07-30 14:24   ` Gatien CHEVALLIER [this message]
2025-07-30 14:52     ` Andrew Lunn
2025-07-30 15:03       ` Daniel Braunwarth
2025-07-30 18:45 ` Florian Fainelli

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=27e10ba4-5656-40a8-a709-c1390fee251f@foss.st.com \
    --to=gatien.chevallier@foss.st.com \
    --cc=andrew@lunn.ch \
    --cc=daniel.braunwarth@kuka.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=florian.fainelli@broadcom.com \
    --cc=hkallweit1@gmail.com \
    --cc=jonathanh@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=rmk+kernel@armlinux.org.uk \
    --cc=treding@nvidia.com \
    /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).