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

On Tue, Jul 22, 2025 at 10:39:53PM +0100, Russell King (Oracle) wrote:
> rtl8211f_get_wol() does not take account of whether the PMEB pin is
> wired or not. Thus, stmmac can't just forward the get_wol() and
> set_wol() ops to the PHY driver and let it decide, as suggested
> earlier. As stmmac gets used with multiple PHYs, (and hey, we can't
> tell what they are, because DT doesn't list what the PHY actually is!)
> we can't know how many other PHY drivers also have this problem.

I've just read a bit more of the RTL8211F datasheet, and looked at the
code, and I'm now wondering whether WoL has even been tested with
RTL8211F. What I'm about to state doesn't negate anything I've said
in my previous reply.


So, the RTL8211F doesn't have a separate PMEB pin. It has a pin that
is shared between "interrupt" and "PMEB".

Register 22, page 0xd40, bit 5 determines whether this pin is used for
PMEB (in which case it is pulsed on wake-up) or whether it is used as
an interrupt. It's one or the other function, but can't be both.

rtl8211f_set_wol() manipulates this bit depending on whether
WAKE_MAGIC is enabled or not.

The effect of this is...

If we're using PHY interrupts from the RTL8211F, and then userspace
configures magic packet WoL on the PHY, then we reconfigure the
interrupt pin to become a wakeup pin, disabling the interrupt
function - we no longer receive interrupts from the RTL8211F !!!!!!!

Yes, the driver does support interrupts for this device!

This is surely wrong because it will break phylib's ability to track
the link state as there will be no further interrupts _and_ phylib
won't be expecting to poll the PHY.

The really funny thing is that the PHY does have the ability to
raise an interrupt if a wakeup occurs through the interrupt pin
(when configured as such) via register 18, page 0xa42, bit 7...
but the driver doesn't touch that.


Jetson Xavier NX uses interrupts from this PHY. Forwarding an
ethtool .set_wol() op to the PHY driver which enables magic packet
will, as things stand, switch the interrupt pin to wake-up only
mode, preventing delivery of further link state change events to
phylib, breaking phylib.

Maybe there's a need for this behaviour with which-ever network
driver first used RTL8211F in the kernel. Maybe the set of network
drivers that use interrupts from the RTL8211F don't use WoL and
vice versa. If there's any network drivers that do forward WoL
calls to the RTL8211F driver _and_ use interrupts from the PHY...
that's just going to break if magic packet WoL is ever enabled at
the PHY.

-- 
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-07-22 22:00 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-21 11:14 [PATCH net-next 0/4] net: add WoL from PHY support for stm32mp135f-dk Gatien Chevallier
2025-07-21 11:14 ` [PATCH net-next 1/4] dt-bindings: net: document st,phy-wol property Gatien Chevallier
2025-07-21 11:30   ` Krzysztof Kozlowski
2025-07-21 12:10     ` Gatien CHEVALLIER
2025-07-21 12:16       ` Krzysztof Kozlowski
2025-07-21 12:54         ` Gatien CHEVALLIER
2025-07-21 13:18       ` Andrew Lunn
2025-07-21 15:56         ` Gatien CHEVALLIER
2025-07-21 17:07           ` Andrew Lunn
2025-07-21 18:08             ` Florian Fainelli
2025-07-22  9:08             ` Gatien CHEVALLIER
2025-07-22 13:40               ` Andrew Lunn
2025-07-22 20:20                 ` Russell King (Oracle)
2025-07-22 20:30                   ` Florian Fainelli
2025-07-22 20:59                   ` Andrew Lunn
2025-07-22 21:39                     ` Russell King (Oracle)
2025-07-22 22:00                       ` Russell King (Oracle) [this message]
2025-07-22 22:57                         ` Russell King (Oracle)
2025-07-23 14:02                         ` Andrew Lunn
2025-07-23 14:23                       ` Andrew Lunn
2025-07-23 18:13                         ` Florian Fainelli
2025-07-23  8:50                   ` Gatien CHEVALLIER
2025-07-23  8:53                     ` Gatien CHEVALLIER
2025-07-23  9:25                       ` Russell King (Oracle)
2025-07-23  9:20                     ` Russell King (Oracle)
2025-07-23 14:35                       ` Gatien CHEVALLIER
2025-07-22  9:13             ` Russell King (Oracle)
2025-07-22  7:32           ` Russell King (Oracle)
2025-07-22  9:10             ` Gatien CHEVALLIER
2025-07-21 11:14 ` [PATCH net-next 2/4] net: stmmac: stm32: add WoL from PHY support Gatien Chevallier
2025-07-21 11:14 ` [PATCH net-next 3/4] net: phy: smsc: fix and improve WoL support Gatien Chevallier
2025-07-21 11:28   ` Russell King (Oracle)
2025-07-21 12:23     ` Gatien CHEVALLIER
2025-07-21 13:26   ` Andrew Lunn
2025-07-21 14:19     ` Gatien CHEVALLIER
2025-07-21 14:23       ` Andrew Lunn
2025-07-21 11:14 ` [PATCH net-next 4/4] arm: dts: st: activate ETH1 WoL from PHY on stm32mp135f-dk Gatien Chevallier

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=aIAKAlkdB5S8UiYx@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=krzk@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).