From: Andrew Lunn <andrew@lunn.ch>
To: Icenowy Zheng <uwu@icenowy.me>
Cc: "Russell King (Oracle)" <linux@armlinux.org.uk>,
Rob Herring <robh@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>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Chaoyi Chen <chaoyi.chen@rock-chips.com>,
Matthias Schiffer <matthias.schiffer@ew.tq-group.com>,
Heiner Kallweit <hkallweit1@gmail.com>,
netdev@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH net v2] dt-bindings: net: ethernet-controller: Add informative text about RGMII delays
Date: Thu, 5 Jun 2025 15:48:37 +0200 [thread overview]
Message-ID: <ba7b290d-0cd1-4809-822a-bfe902684d7e@lunn.ch> (raw)
In-Reply-To: <84c534f9dbfa7c82300863cd40e5a9b6e6e29411.camel@icenowy.me>
On Thu, Jun 05, 2025 at 06:51:43PM +0800, Icenowy Zheng wrote:
> 在 2025-06-05星期四的 10:41 +0100,Russell King (Oracle)写道:
> > On Thu, Jun 05, 2025 at 05:06:43PM +0800, Icenowy Zheng wrote:
> > > In addition, analyzing existing Ethernet drivers, I found two
> > > drivers
> > > with contradition: stmicro/stmmac/dwmac-qcom-ethqos.c and
> > > ti/icssg/icssg_prueth.c .
> > >
> > > The QCOM ETHQOS driver enables the MAC's TX delay if the phy_mode
> > > is
> > > rgmii or rgmii-rxid, and the PRU ETH driver, which works on some
> > > MAC
> > > with hardcoded TX delay, rejects rgmii and rgmii-rxid, and patches
> > > rgmii-id or rgmii-txid to remove the txid part.
> >
> > No, this is wrong.
> >
> > First, it does not reject any RGMII mode. See qcom_ethqos_probe() and
> > the switch() in there. All four RGMII modes are accepted.
>
> Well my sentence have its subject switched here. I mean the TI PRU ETH
> driver is rejecting modes.
Which is theoretically fine. I've not looked at this driver in
particular, but there are some MACs were you cannot disable the delay.
The MAC always imposes 2ns delay. That would mean a PCB which also has
extra long clock lines is simply FUBAR, cannot work, and 'rgmii' is
invalid, so reject it.
> Well I am not sure, considering two examples I raised here (please note
> I am comparing QCOM ETHQOS and TI PRUETH two drivers, they have
> contrary handling of RGMII modes, and one matches the old binding
> document, one matches the new one).
Nope, i fully agree with Russell, the binding has not changed, just the
words to explain the binding.
Just for a minute, consider your interpretation of the old text is
wrong. Read the old text again and again, and see if you can find an
interpretation which is the same as the new text. If you do:
* It proves our point that describing what this means is hard, and
developers will get it wrong.
* There is an interpretation of both the old and new where nothing
changed.
* You have to be careful looking at drivers, because some percent of
developers also interpreted it wrongly, and have broken
implementations as a result. You cannot say the binding means X,
not Y, because there is a driver using meaning X.
My hope with the new text is that it focuses on hardware, which is
what DT is about. You can look at the schematic, see if there is extra
long clock lines or not, and then decided on 'rgmii-id' if there are
not, and 'rgmii' is there are. The rest then follows from that.
And if you look at the questions i've been asking for the last year or
more, i always start with, "Does the PCB have extra long clock
lines?".
> > The RGMII modes have been documented in
> > Documentation/networking/phy.rst
> > (Documentation/networking/phy.txt predating) since:
>
> I checked the document here, and it seems that it's against the changed
> binding document (it matches the original one):
>
> The phy.rst document says:
> ```
> * PHY_INTERFACE_MODE_RGMII: the PHY is not responsible for inserting
> any
> internal delay by itself, it assumes that either the Ethernet MAC (if
> capable)
> or the PCB traces insert the correct 1.5-2ns delay
> ```
>
> The changed binding document says:
You are not reading it carefully enough. The binding describes
hardware, the board. phy.rst describes the phylib interface. They are
different.
Andrew
next prev parent reply other threads:[~2025-06-05 13:48 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-30 16:21 Andrew Lunn
2025-05-01 14:28 ` Conor Dooley
2025-05-06 0:00 ` patchwork-bot+netdevbpf
2025-05-07 7:17 ` Matthias Schiffer
2025-06-04 10:52 ` Icenowy Zheng
2025-06-04 12:23 ` Andrew Lunn
2025-06-05 9:06 ` Icenowy Zheng
2025-06-05 9:41 ` Russell King (Oracle)
2025-06-05 10:51 ` Icenowy Zheng
2025-06-05 12:44 ` Russell King (Oracle)
2025-06-05 13:48 ` Andrew Lunn [this message]
2025-06-11 8:03 ` Icenowy Zheng
2025-06-11 8:39 ` Russell King (Oracle)
2025-06-11 12:11 ` Icenowy Zheng
2025-06-11 15:28 ` Andrew Lunn
2025-06-13 8:01 ` Icenowy Zheng
2025-06-13 8:35 ` Russell King (Oracle)
2025-06-13 8:43 ` Icenowy Zheng
2025-06-13 9:05 ` Russell King (Oracle)
2025-06-11 15:05 ` Andrew Lunn
2025-06-05 13:20 ` Andrew Lunn
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=ba7b290d-0cd1-4809-822a-bfe902684d7e@lunn.ch \
--to=andrew@lunn.ch \
--cc=andrew+netdev@lunn.ch \
--cc=chaoyi.chen@rock-chips.com \
--cc=conor+dt@kernel.org \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=edumazet@google.com \
--cc=hkallweit1@gmail.com \
--cc=krzk+dt@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=matthias.schiffer@ew.tq-group.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=robh@kernel.org \
--cc=uwu@icenowy.me \
/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
all inboxes | Powered by JetHome®