From: Jerome Brunet <jbrunet@baylibre.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: 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>,
Chen-Yu Tsai <wens@kernel.org>,
Jernej Skrabec <jernej.skrabec@gmail.com>,
Samuel Holland <samuel@sholland.org>,
Richard Cochran <richardcochran@gmail.com>,
Maxime Ripard <mripard@kernel.org>,
Maxime Coquelin <mcoquelin.stm32@gmail.com>,
Alexandre Torgue <alexandre.torgue@foss.st.com>,
Philipp Zabel <p.zabel@pengutronix.de>,
Maxime Chevallier <maxime.chevallier@bootlin.com>,
netdev@vger.kernel.org, devicetree@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org,
linux-stm32@st-md-mailman.stormreply.com,
Andre Przywara <andre.przywara@arm.com>
Subject: Re: [PATCH net-next v3 0/5] net: stmmac: Add support for Allwinner A733 GMAC210
Date: Fri, 25 Sep 2026 10:26:38 +0200 [thread overview]
Message-ID: <1jse2x91oh.fsf@starbuckisacylon.baylibre.com> (raw)
In-Reply-To: <491f043e-6dc6-4936-a490-31a3362c5b6e@lunn.ch>
On jeu. 24 sept. 2026 at 18:02, Andrew Lunn <andrew@lunn.ch> wrote:
>> It is not the PCB doing the delays so rgmii-id it is (in DT) - got it.
>
> Yep.
>
>>
>> I dunno what is sane or not, but the allwinner dwmac drivers do set some
>> delays. sun8i-dwmac and sun55i-dwmac do so, even before this change.
>
> As the document i linked to says, doing small tuning delays is
> fine. We strongly prefer the PHY does the 2ns delay, if it can.
Understood.
>
>> If I understand correctly :
>>
>> """
>> When the MAC implements the delay, it must ensure that the PHY does not
>> also implement the same delay. So it must modify the phy-mode it passes
>> to the PHY, removing the delay it has added. Failure to remove the delay
>> will result in a non-functioning link
>> """
>>
>> IOW when the gmac has *-internal-delay-ps set and honors them, it should
>> also amend phymode seen by PHY to make sure it does not add its own
>> delays, should it ever be fixed ?
>
> You need to differentiate between small fine tuning delays, and the
> 2ns delay required by the RGMII standard. If the MAC is just doing
> fine tuning, you need to still pass PHY_INTERFACE_MODE_RGMII_ID so the
> PHY adds the 2ns delay. If the MAC is adding a big delay, you need to
> pass PHY_INTERFACE_MODE_RGMII to the PHY.
The PHY is one concern but the series here does not really address this
topic. DTS and board specific concerns will come later.
It is really just the MAC. So, how does the MAC is supposed to
make the decision to amend the PHY mode ? is there a threshold you'd
like to recommend for this differentiation ?
>
> If you have the schematics, it would be good to confirm the strapping
> on the PHY, and add a comment in the DTS file about what is going on
> here.
>
> The other option i hinted at was use phy-mode = 'na'. I'm still
> considering this, it has some advantages.
>
> The problem with passing PHY_INTERFACE_MODE_RGMII or
> PHY_INTERFACE_MODE_RGMII_ID to the PHY is we have no way of knowing if
> the hardware is honouring it. It appears the board you are working on
> does the opposite of what we would prefer. I guess there are going to
> be other similar boards, but are they going to get a similar level of
> review and the issues spotted? Are they going to end up passing the
> wrong PHY_INTERFACE_MODE_RGMII value to the PHY?
>
> By making the PHY reject PHY_INTERFACE_MODE_RGMII* it makes it very
> clear something odd is going on here, and care needs to be taken. It
> will be very much in your face for DT writers, so they are more likely
> to get it correct.
We do need the information that the link is RGMII (not RMII or GMII) to
setup the MAC properly though. Aside from that, It is all fine by me.
>
> And if in the future we do find out how to control the PHY delays in
> software, boards using phy-mode = 'na' are safe, no change. Other
> boards which got passed review could well break. Been there, done
> that, don't want to repeat it.
>
>> > But this PHY is going to cause you lots of problems.
>>
>> We don't get to choose I'm afraid :)
>
> Yes, you have just the first victim.
>
> It would be nice if somebody reached out to the vendor and asked if:
>
> Can the RGMII delays be configured in software?
>
> if not:
>
> Can the RGMII delay strapping be seen in software?
>
> If we know the strapping we can at least return EOPNOTSUPP if the
> requested does not match what the hardware is doing, and we get a
> clear indication of a problem.
I'll try to reach out, just in case. I have the schematics but without
the PHY doc, it does not help much.
Just to get back on topic, The problems you mention here are more PHY ones
when net support lands from this board in DT (I'll remember to Cc you of
that one when it comes)
For the MAC part here (and its bindings) it does not change anything,
unless I'm missing something. This series just adds support for a
another MAC variant in an existing driver.
>
> Andrew
--
Jerome
prev parent reply other threads:[~2026-09-25 8:26 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-23 20:47 Jerome Brunet
2026-09-23 20:47 ` [PATCH net-next v3 1/5] dt-bindings: net: sun8i-emac: Add A733 GMAC210 compatible Jerome Brunet
2026-09-23 20:47 ` [PATCH net-next v3 2/5] net: stmmac: sun55i: Add per-compatible match data Jerome Brunet
2026-09-23 20:47 ` [PATCH net-next v3 3/5] net: stmmac: sun55i: Make the delay step configurable Jerome Brunet
2026-09-24 2:30 ` Andrew Lunn
2026-09-24 8:53 ` Jerome Brunet
2026-09-24 12:55 ` Andrew Lunn
2026-09-23 20:47 ` [PATCH net-next v3 4/5] net: stmmac: sun55i: Support TX delay extension bits Jerome Brunet
2026-09-23 20:47 ` [PATCH net-next v3 5/5] net: stmmac: sun55i: Add support for Allwinner A733 GMAC210 Jerome Brunet
2026-09-23 22:15 ` [PATCH net-next v3 0/5] net: stmmac: " Andrew Lunn
2026-09-23 22:19 ` Andrew Lunn
2026-09-24 8:40 ` Jerome Brunet
2026-09-24 12:54 ` Andrew Lunn
2026-09-24 15:27 ` Jerome Brunet
2026-09-24 16:02 ` Andrew Lunn
2026-09-25 8:26 ` Jerome Brunet [this message]
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=1jse2x91oh.fsf@starbuckisacylon.baylibre.com \
--to=jbrunet@baylibre.com \
--cc=alexandre.torgue@foss.st.com \
--cc=andre.przywara@arm.com \
--cc=andrew+netdev@lunn.ch \
--cc=andrew@lunn.ch \
--cc=conor+dt@kernel.org \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=edumazet@google.com \
--cc=jernej.skrabec@gmail.com \
--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=linux-sunxi@lists.linux.dev \
--cc=maxime.chevallier@bootlin.com \
--cc=mcoquelin.stm32@gmail.com \
--cc=mripard@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=p.zabel@pengutronix.de \
--cc=pabeni@redhat.com \
--cc=richardcochran@gmail.com \
--cc=robh@kernel.org \
--cc=samuel@sholland.org \
--cc=wens@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
all inboxes | Powered by JetHome®