[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <73bf2977-ad1a-45fa-9b06-5df083c060a8@lunn.ch>
Date: Wed, 21 Jan 2026 14:45:24 +0100
From: Andrew Lunn <andrew@...n.ch>
To: "Russell King (Oracle)" <linux@...linux.org.uk>
Cc: Inochi Amaoto <inochiama@...il.com>,
Andrew Lunn <andrew+netdev@...n.ch>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>, Yixun Lan <dlan@...too.org>,
Maxime Coquelin <mcoquelin.stm32@...il.com>,
Alexandre Torgue <alexandre.torgue@...s.st.com>,
Richard Cochran <richardcochran@...il.com>,
Paul Walmsley <pjw@...nel.org>, Palmer Dabbelt <palmer@...belt.com>,
Albert Ou <aou@...s.berkeley.edu>, Alexandre Ghiti <alex@...ti.fr>,
Yao Zi <ziyao@...root.org>,
Yanteng Si <siyanteng@...oftware.com.cn>,
Vladimir Oltean <vladimir.oltean@....com>,
Lad Prabhakar <prabhakar.mahadev-lad.rj@...renesas.com>,
Chen-Yu Tsai <wens@...nel.org>,
Choong Yong Liang <yong.liang.choong@...ux.intel.com>,
Shangjuan Wei <weishangjuan@...incomputing.com>,
Jernej Skrabec <jernej.skrabec@...il.com>,
Boon Khai Ng <boon.khai.ng@...era.com>,
Maxime Chevallier <maxime.chevallier@...tlin.com>,
Quentin Schulz <quentin.schulz@...rry.de>,
Giuseppe Cavallaro <peppe.cavallaro@...com>,
Jose Abreu <joabreu@...opsys.com>, netdev@...r.kernel.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-riscv@...ts.infradead.org, spacemit@...ts.linux.dev,
linux-stm32@...md-mailman.stormreply.com,
linux-arm-kernel@...ts.infradead.org,
Longbin Li <looong.bin@...il.com>
Subject: Re: [PATCH net-next v2 3/3] net: stmmac: Add glue layer for Spacemit
K3 SoC
On Wed, Jan 21, 2026 at 12:05:30PM +0000, Russell King (Oracle) wrote:
> On Wed, Jan 21, 2026 at 03:13:11PM +0800, Inochi Amaoto wrote:
> > + mask = RGMII_RX_DLINE_STEP | RGMII_TX_DLINE_CODE | RGMII_TX_DLINE_EN |
> > + RGMII_TX_DLINE_STEP | RGMII_RX_DLINE_CODE | RGMII_RX_DLINE_EN;
> > + val = FIELD_PREP(RGMII_TX_DLINE_STEP, tx_config) |
> > + FIELD_PREP(RGMII_TX_DLINE_CODE, tx_code) | RGMII_TX_DLINE_EN |
> > + FIELD_PREP(RGMII_RX_DLINE_STEP, rx_config) |
> > + FIELD_PREP(RGMII_RX_DLINE_CODE, rx_code) | RGMII_RX_DLINE_EN;
>
> So your reply where you basically stated that all the RGMII.*DLINE.*
> constants here should be the same was nonsense. How can we trust your
> replies?
>
> > +static int spacemit_dwmac_fix_delay(struct plat_stmmacenet_data *plat_dat,
> > + struct regmap *apmu,
> > + unsigned int dline_offset,
> > + unsigned int tx_delay, unsigned int rx_delay)
> > +{
> > + bool mac_rxid = rx_delay != 0;
> > + bool mac_txid = tx_delay != 0;
> > + unsigned int rx_config = 0;
> > + unsigned int tx_config = 0;
> > + int rx_code;
> > + int tx_code;
> > +
> > + plat_dat->phy_interface = phy_fix_phy_mode_for_mac_delays(plat_dat->phy_interface,
> > + mac_txid,
> > + mac_rxid);
>
> Maybe Andrew can confirm, but this function was to fix up existing
> broken DT, and shouldn't be used by brand new drivers.
Hi Russell, thanks for pointing this out.
This function should not be used in this case. MAC drivers in general
only add small delays, in order to do fine tuning. The PHY adds the
2ns delay. There are however some MACs who cannot disable their 2ns
delay, or have historically been broken, and add 2ns delay. In such
cases, the phy_interface passed to the PHY needs masking, to indicate
the PHY should not add the 2ns delays. That is what this function
does.
Please don't call it. Pass phy_interface as is to the PHY.
Andrew
Powered by blists - more mailing lists