* Re: [PATCH net-next 1/4] dt-bindings: net: ethernet-controller: update descriptions of RGMII modes
2025-04-15 10:18 ` [PATCH net-next 1/4] dt-bindings: net: ethernet-controller: update descriptions of RGMII modes Matthias Schiffer
@ 2025-04-15 10:36 ` Siddharth Vadapalli
2025-04-15 11:28 ` Matthias Schiffer
` (2 more replies)
2025-04-15 10:54 ` Maxime Chevallier
` (3 subsequent siblings)
4 siblings, 3 replies; 47+ messages in thread
From: Siddharth Vadapalli @ 2025-04-15 10:36 UTC (permalink / raw)
To: Matthias Schiffer
Cc: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Andy Whitcroft, Dwaipayan Ray, Lukas Bulwahn, Joe Perches,
Jonathan Corbet, Nishanth Menon, Vignesh Raghavendra,
Siddharth Vadapalli, Roger Quadros, Tero Kristo, linux-doc,
linux-kernel, netdev, devicetree, linux-arm-kernel, linux
On Tue, Apr 15, 2025 at 12:18:01PM +0200, Matthias Schiffer wrote:
> As discussed [1], the comments for the different rgmii(-*id) modes do not
> accurately describe what these values mean.
>
> As the Device Tree is primarily supposed to describe the hardware and not
> its configuration, the different modes need to distinguish board designs
If the Ethernet-Controller (MAC) is integrated in an SoC (as is the case
with CPSW Ethernet Switch), and, given that "phy-mode" is a property
added within the device-tree node of the MAC, I fail to understand how
the device-tree can continue "describing" hardware for different board
designs using the same SoC (unchanged MAC HW).
How do we handle situations where a given MAC supports various
"phy-modes" in HW? Shouldn't "phy-modes" then be a "list" to technically
descibe the HW? Even if we set aside the "rgmii" variants that this
series is attempting to address, the CPSW MAC supports "sgmii", "qsgmii"
and "usxgmii/xfi" as well.
> (if a delay is built into the PCB using different trace lengths); whether
> a delay is added on the MAC or the PHY side when needed should not matter.
>
> Unfortunately, implementation in MAC drivers is somewhat inconsistent
> where a delay is fixed or configurable on the MAC side. As a first step
> towards sorting this out, improve the documentation.
>
> Link: https://lore.kernel.org/lkml/d25b1447-c28b-4998-b238-92672434dc28@lunn.ch/ [1]
> Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
> ---
> .../bindings/net/ethernet-controller.yaml | 16 +++++++++-------
> 1 file changed, 9 insertions(+), 7 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/net/ethernet-controller.yaml b/Documentation/devicetree/bindings/net/ethernet-controller.yaml
> index 45819b2358002..2ddc1ce2439a6 100644
> --- a/Documentation/devicetree/bindings/net/ethernet-controller.yaml
> +++ b/Documentation/devicetree/bindings/net/ethernet-controller.yaml
> @@ -74,19 +74,21 @@ properties:
> - rev-rmii
> - moca
>
> - # RX and TX delays are added by the MAC when required
> + # RX and TX delays are part of the board design (through PCB traces). MAC
> + # and PHY must not add delays.
> - rgmii
>
> - # RGMII with internal RX and TX delays provided by the PHY,
> - # the MAC should not add the RX or TX delays in this case
> + # RGMII with internal RX and TX delays provided by the MAC or PHY. No
> + # delays are included in the board design; this is the most common case
> + # in modern designs.
> - rgmii-id
>
> - # RGMII with internal RX delay provided by the PHY, the MAC
> - # should not add an RX delay in this case
> + # RGMII with internal RX delay provided by the MAC or PHY. TX delay is
> + # part of the board design.
> - rgmii-rxid
>
> - # RGMII with internal TX delay provided by the PHY, the MAC
> - # should not add an TX delay in this case
> + # RGMII with internal TX delay provided by the MAC or PHY. RX delay is
> + # part of the board design.
Since all of the above is documented in "ethernet-controller.yaml" and
not "ethernet-phy.yaml", describing what the "MAC" should or shouldn't
do seems accurate, and modifying it to describe what the "PHY" should or
shouldn't do seems wrong.
> - rgmii-txid
> - rtbi
> - smii
Regards,
Siddharth.
^ permalink raw reply [flat|nested] 47+ messages in thread
* Re: [PATCH net-next 1/4] dt-bindings: net: ethernet-controller: update descriptions of RGMII modes
2025-04-15 10:36 ` Siddharth Vadapalli
@ 2025-04-15 11:28 ` Matthias Schiffer
2025-04-15 11:55 ` Siddharth Vadapalli
2025-04-18 20:40 ` Andrew Lunn
2025-04-22 8:37 ` Russell King (Oracle)
2 siblings, 1 reply; 47+ messages in thread
From: Matthias Schiffer @ 2025-04-15 11:28 UTC (permalink / raw)
To: Siddharth Vadapalli
Cc: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Andy Whitcroft, Dwaipayan Ray, Lukas Bulwahn, Joe Perches,
Jonathan Corbet, Nishanth Menon, Vignesh Raghavendra,
Roger Quadros, Tero Kristo, linux-doc, linux-kernel, netdev,
devicetree, linux-arm-kernel, linux
On Tue, 2025-04-15 at 16:06 +0530, Siddharth Vadapalli wrote:
>
> On Tue, Apr 15, 2025 at 12:18:01PM +0200, Matthias Schiffer wrote:
> > As discussed [1], the comments for the different rgmii(-*id) modes do not
> > accurately describe what these values mean.
> >
> > As the Device Tree is primarily supposed to describe the hardware and not
> > its configuration, the different modes need to distinguish board designs
>
> If the Ethernet-Controller (MAC) is integrated in an SoC (as is the case
> with CPSW Ethernet Switch), and, given that "phy-mode" is a property
> added within the device-tree node of the MAC, I fail to understand how
> the device-tree can continue "describing" hardware for different board
> designs using the same SoC (unchanged MAC HW).
The setting is part of the MAC node, but it is always set in the board DTS,
together with assigning a PHY to the MAC.
> How do we handle situations where a given MAC supports various
> "phy-modes" in HW? Shouldn't "phy-modes" then be a "list" to technically
> descibe the HW? Even if we set aside the "rgmii" variants that this
> series is attempting to address, the CPSW MAC supports "sgmii", "qsgmii"
> and "usxgmii/xfi" as well.
This is not about PHY mode support of the MAC, but the mode to be used on a
particular board. I would not expect a board to use multiple different
interfaces with a single PHY (and if such cases exist, I consider them out of
scope for this patch series).
>
> > (if a delay is built into the PCB using different trace lengths); whether
> > a delay is added on the MAC or the PHY side when needed should not matter.
> >
> > Unfortunately, implementation in MAC drivers is somewhat inconsistent
> > where a delay is fixed or configurable on the MAC side. As a first step
> > towards sorting this out, improve the documentation.
> >
> > Link: https://lore.kernel.org/lkml/d25b1447-c28b-4998-b238-92672434dc28@lunn.ch/ [1]
> > Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
> > ---
> > .../bindings/net/ethernet-controller.yaml | 16 +++++++++-------
> > 1 file changed, 9 insertions(+), 7 deletions(-)
> >
> > diff --git a/Documentation/devicetree/bindings/net/ethernet-controller.yaml b/Documentation/devicetree/bindings/net/ethernet-controller.yaml
> > index 45819b2358002..2ddc1ce2439a6 100644
> > --- a/Documentation/devicetree/bindings/net/ethernet-controller.yaml
> > +++ b/Documentation/devicetree/bindings/net/ethernet-controller.yaml
> > @@ -74,19 +74,21 @@ properties:
> > - rev-rmii
> > - moca
> >
> > - # RX and TX delays are added by the MAC when required
> > + # RX and TX delays are part of the board design (through PCB traces). MAC
> > + # and PHY must not add delays.
> > - rgmii
> >
> > - # RGMII with internal RX and TX delays provided by the PHY,
> > - # the MAC should not add the RX or TX delays in this case
> > + # RGMII with internal RX and TX delays provided by the MAC or PHY. No
> > + # delays are included in the board design; this is the most common case
> > + # in modern designs.
> > - rgmii-id
> >
> > - # RGMII with internal RX delay provided by the PHY, the MAC
> > - # should not add an RX delay in this case
> > + # RGMII with internal RX delay provided by the MAC or PHY. TX delay is
> > + # part of the board design.
> > - rgmii-rxid
> >
> > - # RGMII with internal TX delay provided by the PHY, the MAC
> > - # should not add an TX delay in this case
> > + # RGMII with internal TX delay provided by the MAC or PHY. RX delay is
> > + # part of the board design.
>
> Since all of the above is documented in "ethernet-controller.yaml" and
> not "ethernet-phy.yaml", describing what the "MAC" should or shouldn't
> do seems accurate, and modifying it to describe what the "PHY" should or
> shouldn't do seems wrong.
The settings describe the connection between MAC and PHY, thus their explanation
must mention both to make sense. See the linked discussion with Andrew for
details.
Best,
Matthias
>
> > - rgmii-txid
> > - rtbi
> > - smii
>
> Regards,
> Siddharth.
--
TQ-Systems GmbH | Mühlstraße 2, Gut Delling | 82229 Seefeld, Germany
Amtsgericht München, HRB 105018
Geschäftsführer: Detlef Schneider, Rüdiger Stahl, Stefan Schneider
https://www.tq-group.com/
^ permalink raw reply [flat|nested] 47+ messages in thread
* Re: [PATCH net-next 1/4] dt-bindings: net: ethernet-controller: update descriptions of RGMII modes
2025-04-15 11:28 ` Matthias Schiffer
@ 2025-04-15 11:55 ` Siddharth Vadapalli
2025-04-16 7:41 ` Matthias Schiffer
2025-04-22 8:41 ` Russell King (Oracle)
0 siblings, 2 replies; 47+ messages in thread
From: Siddharth Vadapalli @ 2025-04-15 11:55 UTC (permalink / raw)
To: Matthias Schiffer
Cc: Siddharth Vadapalli, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Andy Whitcroft, Dwaipayan Ray, Lukas Bulwahn,
Joe Perches, Jonathan Corbet, Nishanth Menon, Vignesh Raghavendra,
Roger Quadros, Tero Kristo, linux-doc, linux-kernel, netdev,
devicetree, linux-arm-kernel, linux
On Tue, Apr 15, 2025 at 01:28:48PM +0200, Matthias Schiffer wrote:
> On Tue, 2025-04-15 at 16:06 +0530, Siddharth Vadapalli wrote:
> >
> > On Tue, Apr 15, 2025 at 12:18:01PM +0200, Matthias Schiffer wrote:
> > > As discussed [1], the comments for the different rgmii(-*id) modes do not
> > > accurately describe what these values mean.
> > >
> > > As the Device Tree is primarily supposed to describe the hardware and not
> > > its configuration, the different modes need to distinguish board designs
> >
> > If the Ethernet-Controller (MAC) is integrated in an SoC (as is the case
> > with CPSW Ethernet Switch), and, given that "phy-mode" is a property
> > added within the device-tree node of the MAC, I fail to understand how
> > the device-tree can continue "describing" hardware for different board
> > designs using the same SoC (unchanged MAC HW).
>
> The setting is part of the MAC node, but it is always set in the board DTS,
> together with assigning a PHY to the MAC.
The MAC is the same independent of which board it is used in. So are we
really describing the "MAC" or configuring the "MAC"? Isn't it the PHY
along with the PCB lines on a given board that determine how the "MAC"
should be "configured" to make the combination of "MAC" + "PHY"
functional together?
>
> > How do we handle situations where a given MAC supports various
> > "phy-modes" in HW? Shouldn't "phy-modes" then be a "list" to technically
> > descibe the HW? Even if we set aside the "rgmii" variants that this
> > series is attempting to address, the CPSW MAC supports "sgmii", "qsgmii"
> > and "usxgmii/xfi" as well.
>
> This is not about PHY mode support of the MAC, but the mode to be used on a
> particular board. I would not expect a board to use multiple different
> interfaces with a single PHY (and if such cases exist, I consider them out of
For a fixed PHY, the MAC will be "configured" to operate in a set of
modes supported by the PHY. The HW description is coming from the PHY
that has been "fixed", and not the MAC. But the "phy-mode" property
resides within the device-tree node of the MAC and not the PHY. So are
we still "describing" the MAC when it is the "PHY" that introduces the
limitation or requires the MAC to be configured for a particular
"phy-mode"?
> scope for this patch series).
>
> >
> > > (if a delay is built into the PCB using different trace lengths); whether
> > > a delay is added on the MAC or the PHY side when needed should not matter.
> > >
> > > Unfortunately, implementation in MAC drivers is somewhat inconsistent
> > > where a delay is fixed or configurable on the MAC side. As a first step
> > > towards sorting this out, improve the documentation.
While this patch is improving the documentation and making it consistent
when it comes to the description of "rgmii" by stating that the "MAC"
shouldn't add a delay, for the remaining cases, as to who adds the delay
and whether or not the MAC should add a delay has been left open.
Existing documentation clarifies what the MAC should do for each case
except "rgmii" which is being fixed by your patch.
> > >
> > > Link: https://lore.kernel.org/lkml/d25b1447-c28b-4998-b238-92672434dc28@lunn.ch/ [1]
> > > Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
> > > ---
> > > .../bindings/net/ethernet-controller.yaml | 16 +++++++++-------
> > > 1 file changed, 9 insertions(+), 7 deletions(-)
> > >
> > > diff --git a/Documentation/devicetree/bindings/net/ethernet-controller.yaml b/Documentation/devicetree/bindings/net/ethernet-controller.yaml
> > > index 45819b2358002..2ddc1ce2439a6 100644
> > > --- a/Documentation/devicetree/bindings/net/ethernet-controller.yaml
> > > +++ b/Documentation/devicetree/bindings/net/ethernet-controller.yaml
> > > @@ -74,19 +74,21 @@ properties:
> > > - rev-rmii
> > > - moca
> > >
> > > - # RX and TX delays are added by the MAC when required
> > > + # RX and TX delays are part of the board design (through PCB traces). MAC
> > > + # and PHY must not add delays.
> > > - rgmii
> > >
> > > - # RGMII with internal RX and TX delays provided by the PHY,
> > > - # the MAC should not add the RX or TX delays in this case
> > > + # RGMII with internal RX and TX delays provided by the MAC or PHY. No
> > > + # delays are included in the board design; this is the most common case
> > > + # in modern designs.
> > > - rgmii-id
> > >
> > > - # RGMII with internal RX delay provided by the PHY, the MAC
> > > - # should not add an RX delay in this case
> > > + # RGMII with internal RX delay provided by the MAC or PHY. TX delay is
> > > + # part of the board design.
> > > - rgmii-rxid
> > >
> > > - # RGMII with internal TX delay provided by the PHY, the MAC
> > > - # should not add an TX delay in this case
> > > + # RGMII with internal TX delay provided by the MAC or PHY. RX delay is
> > > + # part of the board design.
[...]
Regards,
Siddharth.
^ permalink raw reply [flat|nested] 47+ messages in thread
* Re: [PATCH net-next 1/4] dt-bindings: net: ethernet-controller: update descriptions of RGMII modes
2025-04-15 11:55 ` Siddharth Vadapalli
@ 2025-04-16 7:41 ` Matthias Schiffer
2025-04-22 8:56 ` Russell King (Oracle)
2025-04-22 8:41 ` Russell King (Oracle)
1 sibling, 1 reply; 47+ messages in thread
From: Matthias Schiffer @ 2025-04-16 7:41 UTC (permalink / raw)
To: Siddharth Vadapalli
Cc: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Andy Whitcroft, Dwaipayan Ray, Lukas Bulwahn, Joe Perches,
Jonathan Corbet, Nishanth Menon, Vignesh Raghavendra,
Roger Quadros, Tero Kristo, linux-doc, linux-kernel, netdev,
devicetree, linux-arm-kernel, linux
On Tue, 2025-04-15 at 17:25 +0530, Siddharth Vadapalli wrote:
>
> On Tue, Apr 15, 2025 at 01:28:48PM +0200, Matthias Schiffer wrote:
> > On Tue, 2025-04-15 at 16:06 +0530, Siddharth Vadapalli wrote:
> > >
> > > On Tue, Apr 15, 2025 at 12:18:01PM +0200, Matthias Schiffer wrote:
> > > > As discussed [1], the comments for the different rgmii(-*id) modes do not
> > > > accurately describe what these values mean.
> > > >
> > > > As the Device Tree is primarily supposed to describe the hardware and not
> > > > its configuration, the different modes need to distinguish board designs
> > >
> > > If the Ethernet-Controller (MAC) is integrated in an SoC (as is the case
> > > with CPSW Ethernet Switch), and, given that "phy-mode" is a property
> > > added within the device-tree node of the MAC, I fail to understand how
> > > the device-tree can continue "describing" hardware for different board
> > > designs using the same SoC (unchanged MAC HW).
> >
> > The setting is part of the MAC node, but it is always set in the board DTS,
> > together with assigning a PHY to the MAC.
>
> The MAC is the same independent of which board it is used in. So are we
> really describing the "MAC" or configuring the "MAC"? Isn't it the PHY
> along with the PCB lines on a given board that determine how the "MAC"
> should be "configured" to make the combination of "MAC" + "PHY"
> functional together?
>
> >
> > > How do we handle situations where a given MAC supports various
> > > "phy-modes" in HW? Shouldn't "phy-modes" then be a "list" to technically
> > > descibe the HW? Even if we set aside the "rgmii" variants that this
> > > series is attempting to address, the CPSW MAC supports "sgmii", "qsgmii"
> > > and "usxgmii/xfi" as well.
> >
> > This is not about PHY mode support of the MAC, but the mode to be used on a
> > particular board. I would not expect a board to use multiple different
> > interfaces with a single PHY (and if such cases exist, I consider them out of
>
> For a fixed PHY, the MAC will be "configured" to operate in a set of
> modes supported by the PHY. The HW description is coming from the PHY
> that has been "fixed", and not the MAC. But the "phy-mode" property
> resides within the device-tree node of the MAC and not the PHY. So are
> we still "describing" the MAC when it is the "PHY" that introduces the
> limitation or requires the MAC to be configured for a particular
> "phy-mode"?
The phy-mode property does not describe the MAC, but how MAC and PHY are
connected. The MAC node just happens to be where this information is placed in
the Device Tree (Using graph nodes to describe the connection between MAC and
PHY seems like overkill...)
Also note that (as I understand it) I'm not changing anything, I'm updating the
documentation to reflect what has been the intended behavior already. Please see
the previous discussion with Andrew that I linked, where he convinced me that
this is the correct approach.
>
> > scope for this patch series).
> >
> > >
> > > > (if a delay is built into the PCB using different trace lengths); whether
> > > > a delay is added on the MAC or the PHY side when needed should not matter.
> > > >
> > > > Unfortunately, implementation in MAC drivers is somewhat inconsistent
> > > > where a delay is fixed or configurable on the MAC side. As a first step
> > > > towards sorting this out, improve the documentation.
>
> While this patch is improving the documentation and making it consistent
> when it comes to the description of "rgmii" by stating that the "MAC"
> shouldn't add a delay, for the remaining cases, as to who adds the delay
> and whether or not the MAC should add a delay has been left open.
> Existing documentation clarifies what the MAC should do for each case
> except "rgmii" which is being fixed by your patch.
Andrew specifically asked to leave it open in the DT bindings whether MAC or PHY
add the delay, and it might differ between drivers (and different operating
systems using the same Device Tree).
Whether the MAC should add a required delay in cases where it's configurable is
an interesting question - not one of the Device Tree bindings, but of driver
implementation.
On Linux, there currently isn't a way for the MAC driver to query from the PHY
whether it could include the delays itself. My assumption is that most PHYs
either don't have internal delays, or the delays are configurable. If this is
the case, having the MAC add them in internal-delay modes and not adding them on
the PHY side would be the best default (also for PHY-less/fixed-link setups,
which should be handled like a PHY without internal delay capabilities.)
@Andrew, does the above seem correct to you?
Best,
Matthias
>
> > > >
> > > > Link: https://lore.kernel.org/lkml/d25b1447-c28b-4998-b238-92672434dc28@lunn.ch/ [1]
> > > > Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
> > > > ---
> > > > .../bindings/net/ethernet-controller.yaml | 16 +++++++++-------
> > > > 1 file changed, 9 insertions(+), 7 deletions(-)
> > > >
> > > > diff --git a/Documentation/devicetree/bindings/net/ethernet-controller.yaml b/Documentation/devicetree/bindings/net/ethernet-controller.yaml
> > > > index 45819b2358002..2ddc1ce2439a6 100644
> > > > --- a/Documentation/devicetree/bindings/net/ethernet-controller.yaml
> > > > +++ b/Documentation/devicetree/bindings/net/ethernet-controller.yaml
> > > > @@ -74,19 +74,21 @@ properties:
> > > > - rev-rmii
> > > > - moca
> > > >
> > > > - # RX and TX delays are added by the MAC when required
> > > > + # RX and TX delays are part of the board design (through PCB traces). MAC
> > > > + # and PHY must not add delays.
> > > > - rgmii
> > > >
> > > > - # RGMII with internal RX and TX delays provided by the PHY,
> > > > - # the MAC should not add the RX or TX delays in this case
> > > > + # RGMII with internal RX and TX delays provided by the MAC or PHY. No
> > > > + # delays are included in the board design; this is the most common case
> > > > + # in modern designs.
> > > > - rgmii-id
> > > >
> > > > - # RGMII with internal RX delay provided by the PHY, the MAC
> > > > - # should not add an RX delay in this case
> > > > + # RGMII with internal RX delay provided by the MAC or PHY. TX delay is
> > > > + # part of the board design.
> > > > - rgmii-rxid
> > > >
> > > > - # RGMII with internal TX delay provided by the PHY, the MAC
> > > > - # should not add an TX delay in this case
> > > > + # RGMII with internal TX delay provided by the MAC or PHY. RX delay is
> > > > + # part of the board design.
>
> [...]
>
> Regards,
> Siddharth.
--
TQ-Systems GmbH | Mühlstraße 2, Gut Delling | 82229 Seefeld, Germany
Amtsgericht München, HRB 105018
Geschäftsführer: Detlef Schneider, Rüdiger Stahl, Stefan Schneider
https://www.tq-group.com/
^ permalink raw reply [flat|nested] 47+ messages in thread
* Re: [PATCH net-next 1/4] dt-bindings: net: ethernet-controller: update descriptions of RGMII modes
2025-04-16 7:41 ` Matthias Schiffer
@ 2025-04-22 8:56 ` Russell King (Oracle)
2025-04-22 14:40 ` Andrew Lunn
0 siblings, 1 reply; 47+ messages in thread
From: Russell King (Oracle) @ 2025-04-22 8:56 UTC (permalink / raw)
To: Matthias Schiffer
Cc: Siddharth Vadapalli, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Andy Whitcroft, Dwaipayan Ray, Lukas Bulwahn,
Joe Perches, Jonathan Corbet, Nishanth Menon, Vignesh Raghavendra,
Roger Quadros, Tero Kristo, linux-doc, linux-kernel, netdev,
devicetree, linux-arm-kernel, linux
On Wed, Apr 16, 2025 at 09:41:57AM +0200, Matthias Schiffer wrote:
> Also note that (as I understand it) I'm not changing anything, I'm updating the
> documentation to reflect what has been the intended behavior already. Please see
> the previous discussion with Andrew that I linked, where he convinced me that
> this is the correct approach.
I think you are as I stated in my email yesterday. The use of "MAC or
PHY" in your new descriptions opens avenues for confusion such as the
scenarios that I described in yesterday's email.
> Andrew specifically asked to leave it open in the DT bindings whether MAC
> or PHY add the delay, and it might differ between drivers (and different
> operating systems using the same Device Tree).
I'm hoping that Andrew will read my email form yesterday and reconsider
because to me this is a backwards step - it doesn't solve the problem
with unclear documentation. I believe it makes the problem worse, and
will lead to more bugs and misunderstandings in this area.
> Whether the MAC should add a required delay in cases where it's configurable
> is an interesting question - not one of the Device Tree bindings, but of
> driver implementation.
Where Andrew gets this from are MAC drivers that detect the rgmii-*id
modes, apply the delay at the MAC, and then convert the value passed to
phylib to PHY_INTERFACE_MODE_RGMII. This is a load of additional special
handling in the MAC driver, and I'd say it's "advanced" usage and takes
more time to review. It's open to mistakes without review by those who
know this "trick", and the chances of phylib maintainers being Cc'd on
MAC drivers is pretty low.
So, I don't think it's something we want to be generally encouraging,
but instead the more normal "phy-mode describes the phy_interface_mode_t
that is passed to phylib" and only allow the "advanced" case in
exceptional cases.
> On Linux, there currently isn't a way for the MAC driver to query from the PHY
> whether it could include the delays itself. My assumption is that most PHYs
> either don't have internal delays, or the delays are configurable.
motorcomm, dp83tg720, icplus, marvell, dp 838678, adin, micrel, tja11xx,
vitesse, dp83822, mscc, at803x, microchip_t1, broadcom, dp83869,
intel-xway, realtek all do handle internal delays. I haven't checked
whether there are PHYs that don't - that's harder because we don't know
whether PHYs that don't mention RGMII in the driver actually support
RGMII or not.
> If this is
> the case, having the MAC add them in internal-delay modes and not adding them on
> the PHY side would be the best default (also for PHY-less/fixed-link setups,
> which should be handled like a PHY without internal delay capabilities.)
See my "advanced" use case above. We do have drivers doing that.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
^ permalink raw reply [flat|nested] 47+ messages in thread
* Re: [PATCH net-next 1/4] dt-bindings: net: ethernet-controller: update descriptions of RGMII modes
2025-04-22 8:56 ` Russell King (Oracle)
@ 2025-04-22 14:40 ` Andrew Lunn
0 siblings, 0 replies; 47+ messages in thread
From: Andrew Lunn @ 2025-04-22 14:40 UTC (permalink / raw)
To: Russell King (Oracle)
Cc: Matthias Schiffer, Siddharth Vadapalli, Andrew Lunn,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Andy Whitcroft,
Dwaipayan Ray, Lukas Bulwahn, Joe Perches, Jonathan Corbet,
Nishanth Menon, Vignesh Raghavendra, Roger Quadros, Tero Kristo,
linux-doc, linux-kernel, netdev, devicetree, linux-arm-kernel,
linux
> I'm hoping that Andrew will read my email form yesterday and reconsider
> because to me this is a backwards step
I will get back to that in a minute.
> > On Linux, there currently isn't a way for the MAC driver to query from the PHY
> > whether it could include the delays itself. My assumption is that most PHYs
> > either don't have internal delays, or the delays are configurable.
>
> motorcomm, dp83tg720, icplus, marvell, dp 838678, adin, micrel, tja11xx,
> vitesse, dp83822, mscc, at803x, microchip_t1, broadcom, dp83869,
> intel-xway, realtek all do handle internal delays. I haven't checked
> whether there are PHYs that don't - that's harder because we don't know
> whether PHYs that don't mention RGMII in the driver actually support
> RGMII or not.
I did look through this once. There are no PHYs with Linux drivers
which support any of the RGMII without supporting all 4 RGMII
modes. So we should just assume all RGMII PHYs can add the delays.
If i remember the history correctly, Renesas built an RDK with a PHY
which did not support RGMII delays. So they where forced to do the
delays in the MAC. But it seems like mainline support for that PHY
never happened.
>
> > If this is
> > the case, having the MAC add them in internal-delay modes and not adding them on
> > the PHY side would be the best default (also for PHY-less/fixed-link setups,
> > which should be handled like a PHY without internal delay capabilities.)
>
> See my "advanced" use case above. We do have drivers doing that.
I agree with Russell here, it is the worse default, not the best
default. It makes it different to nearly every other MAC driver. It
needs extra work in the MAC, which most MAC drivers get wrong. They
also tend not to call out they have done it different to every other
MAC driver in Linux, and so it does not get the needed extra review,
and so is broken. I also think there is some 'vendor SDK' mentality
here. Our MAC can do this, our SDK allows it, the Linux driver must
have it and use it. Pretty much all hardware has features which never
get used, but vendors sometimes have issues with just leaving it
unused.
Andrew
^ permalink raw reply [flat|nested] 47+ messages in thread
* Re: [PATCH net-next 1/4] dt-bindings: net: ethernet-controller: update descriptions of RGMII modes
2025-04-15 11:55 ` Siddharth Vadapalli
2025-04-16 7:41 ` Matthias Schiffer
@ 2025-04-22 8:41 ` Russell King (Oracle)
1 sibling, 0 replies; 47+ messages in thread
From: Russell King (Oracle) @ 2025-04-22 8:41 UTC (permalink / raw)
To: Siddharth Vadapalli
Cc: Matthias Schiffer, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Andy Whitcroft, Dwaipayan Ray, Lukas Bulwahn,
Joe Perches, Jonathan Corbet, Nishanth Menon, Vignesh Raghavendra,
Roger Quadros, Tero Kristo, linux-doc, linux-kernel, netdev,
devicetree, linux-arm-kernel, linux
On Tue, Apr 15, 2025 at 05:25:23PM +0530, Siddharth Vadapalli wrote:
> For a fixed PHY,
No such thing in reality. The kernel has an obsolete idea of a fixed PHY
which is a software-emulated PHY to represent a fixed link, but that is
basically dead with phylink (there is now no PHY for fixed links under
phylink).
As I stated, "phy-mode" describes how the MAC needs to configure its
PHY facing interface, whether there is or is not a PHY present. One can
argue that it's misnamed, but it's buried in deep DT history going back
decades, and there's a rule that we don't break backwards compatibility.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
^ permalink raw reply [flat|nested] 47+ messages in thread
* Re: [PATCH net-next 1/4] dt-bindings: net: ethernet-controller: update descriptions of RGMII modes
2025-04-15 10:36 ` Siddharth Vadapalli
2025-04-15 11:28 ` Matthias Schiffer
@ 2025-04-18 20:40 ` Andrew Lunn
2025-04-22 8:37 ` Russell King (Oracle)
2 siblings, 0 replies; 47+ messages in thread
From: Andrew Lunn @ 2025-04-18 20:40 UTC (permalink / raw)
To: Siddharth Vadapalli
Cc: Matthias Schiffer, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Andy Whitcroft, Dwaipayan Ray, Lukas Bulwahn,
Joe Perches, Jonathan Corbet, Nishanth Menon, Vignesh Raghavendra,
Roger Quadros, Tero Kristo, linux-doc, linux-kernel, netdev,
devicetree, linux-arm-kernel, linux
On Tue, Apr 15, 2025 at 04:06:31PM +0530, Siddharth Vadapalli wrote:
> On Tue, Apr 15, 2025 at 12:18:01PM +0200, Matthias Schiffer wrote:
> > As discussed [1], the comments for the different rgmii(-*id) modes do not
> > accurately describe what these values mean.
> >
> > As the Device Tree is primarily supposed to describe the hardware and not
> > its configuration, the different modes need to distinguish board designs
>
> If the Ethernet-Controller (MAC) is integrated in an SoC (as is the case
> with CPSW Ethernet Switch), and, given that "phy-mode" is a property
> added within the device-tree node of the MAC, I fail to understand how
> the device-tree can continue "describing" hardware for different board
> designs using the same SoC (unchanged MAC HW).
phy-mode describes the link between the MAC and the PHY. So it either
needs to be in the MAC node, or the PHY node when describing the
board. I don't know the history of why it ended up in the MAC node,
but it did.
> Since all of the above is documented in "ethernet-controller.yaml" and
> not "ethernet-phy.yaml", describing what the "MAC" should or shouldn't
> do seems accurate, and modifying it to describe what the "PHY" should or
> shouldn't do seems wrong.
What we are really saying here is, does the PCB have extra long clock
lines in order to add the delays? If yes, the MAC/PHY pair does
nothing. If no, the MAC/PHY pair needs to add the delay.
DT however says nothing about how the MAC/PHY pair should add the
delay. That would be configuration, and DT should try to not describe
configuration. Hence the binding description needs to be neutral to
MAC and PHY.
Linux has a preference, that the PHY does the delay. However, other
operating systems might have other preferences. And since the binding
should be generic across a range of operating systems, we don't
mention Linux's preference.
Andrew
^ permalink raw reply [flat|nested] 47+ messages in thread
* Re: [PATCH net-next 1/4] dt-bindings: net: ethernet-controller: update descriptions of RGMII modes
2025-04-15 10:36 ` Siddharth Vadapalli
2025-04-15 11:28 ` Matthias Schiffer
2025-04-18 20:40 ` Andrew Lunn
@ 2025-04-22 8:37 ` Russell King (Oracle)
2 siblings, 0 replies; 47+ messages in thread
From: Russell King (Oracle) @ 2025-04-22 8:37 UTC (permalink / raw)
To: Siddharth Vadapalli
Cc: Matthias Schiffer, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Andy Whitcroft, Dwaipayan Ray, Lukas Bulwahn,
Joe Perches, Jonathan Corbet, Nishanth Menon, Vignesh Raghavendra,
Roger Quadros, Tero Kristo, linux-doc, linux-kernel, netdev,
devicetree, linux-arm-kernel, linux
On Tue, Apr 15, 2025 at 04:06:31PM +0530, Siddharth Vadapalli wrote:
> On Tue, Apr 15, 2025 at 12:18:01PM +0200, Matthias Schiffer wrote:
> > As discussed [1], the comments for the different rgmii(-*id) modes do not
> > accurately describe what these values mean.
> >
> > As the Device Tree is primarily supposed to describe the hardware and not
> > its configuration, the different modes need to distinguish board designs
>
> If the Ethernet-Controller (MAC) is integrated in an SoC (as is the case
> with CPSW Ethernet Switch), and, given that "phy-mode" is a property
> added within the device-tree node of the MAC, I fail to understand how
> the device-tree can continue "describing" hardware for different board
> designs using the same SoC (unchanged MAC HW).
>
> How do we handle situations where a given MAC supports various
> "phy-modes" in HW? Shouldn't "phy-modes" then be a "list" to technically
> descibe the HW? Even if we set aside the "rgmii" variants that this
> series is attempting to address, the CPSW MAC supports "sgmii", "qsgmii"
> and "usxgmii/xfi" as well.
phy-mode is quite simply the operating mode for the link between the PHY
and the MAC, and depends how the PHY is wired to the MAC.
The list of modes that a MAC supports is dependent on its hardware
design and is generally known by the MAC driver without need to specify
it firmware.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
^ permalink raw reply [flat|nested] 47+ messages in thread
* Re: [PATCH net-next 1/4] dt-bindings: net: ethernet-controller: update descriptions of RGMII modes
2025-04-15 10:18 ` [PATCH net-next 1/4] dt-bindings: net: ethernet-controller: update descriptions of RGMII modes Matthias Schiffer
2025-04-15 10:36 ` Siddharth Vadapalli
@ 2025-04-15 10:54 ` Maxime Chevallier
2025-04-18 20:26 ` Andrew Lunn
` (2 subsequent siblings)
4 siblings, 0 replies; 47+ messages in thread
From: Maxime Chevallier @ 2025-04-15 10:54 UTC (permalink / raw)
To: Matthias Schiffer
Cc: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Andy Whitcroft, Dwaipayan Ray, Lukas Bulwahn, Joe Perches,
Jonathan Corbet, Nishanth Menon, Vignesh Raghavendra,
Siddharth Vadapalli, Roger Quadros, Tero Kristo, linux-doc,
linux-kernel, netdev, devicetree, linux-arm-kernel, linux
Hi Matthias,
On Tue, 15 Apr 2025 12:18:01 +0200
Matthias Schiffer <matthias.schiffer@ew.tq-group.com> wrote:
> As discussed [1], the comments for the different rgmii(-*id) modes do not
> accurately describe what these values mean.
>
> As the Device Tree is primarily supposed to describe the hardware and not
> its configuration, the different modes need to distinguish board designs
> (if a delay is built into the PCB using different trace lengths); whether
> a delay is added on the MAC or the PHY side when needed should not matter.
>
> Unfortunately, implementation in MAC drivers is somewhat inconsistent
> where a delay is fixed or configurable on the MAC side. As a first step
> towards sorting this out, improve the documentation.
>
> Link: https://lore.kernel.org/lkml/d25b1447-c28b-4998-b238-92672434dc28@lunn.ch/ [1]
> Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
Thanks for doing that ! I've tried to document that as well in the
past but it didn't go anywhere and was more clumsy. I think your wording
is clear and helpful.
Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Maxime
^ permalink raw reply [flat|nested] 47+ messages in thread
* Re: [PATCH net-next 1/4] dt-bindings: net: ethernet-controller: update descriptions of RGMII modes
2025-04-15 10:18 ` [PATCH net-next 1/4] dt-bindings: net: ethernet-controller: update descriptions of RGMII modes Matthias Schiffer
2025-04-15 10:36 ` Siddharth Vadapalli
2025-04-15 10:54 ` Maxime Chevallier
@ 2025-04-18 20:26 ` Andrew Lunn
2025-04-21 18:42 ` Rob Herring (Arm)
2025-04-21 19:20 ` Russell King (Oracle)
4 siblings, 0 replies; 47+ messages in thread
From: Andrew Lunn @ 2025-04-18 20:26 UTC (permalink / raw)
To: Matthias Schiffer
Cc: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Andy Whitcroft, Dwaipayan Ray, Lukas Bulwahn, Joe Perches,
Jonathan Corbet, Nishanth Menon, Vignesh Raghavendra,
Siddharth Vadapalli, Roger Quadros, Tero Kristo, linux-doc,
linux-kernel, netdev, devicetree, linux-arm-kernel, linux
On Tue, Apr 15, 2025 at 12:18:01PM +0200, Matthias Schiffer wrote:
> As discussed [1], the comments for the different rgmii(-*id) modes do not
> accurately describe what these values mean.
>
> As the Device Tree is primarily supposed to describe the hardware and not
> its configuration, the different modes need to distinguish board designs
> (if a delay is built into the PCB using different trace lengths); whether
> a delay is added on the MAC or the PHY side when needed should not matter.
>
> Unfortunately, implementation in MAC drivers is somewhat inconsistent
> where a delay is fixed or configurable on the MAC side. As a first step
> towards sorting this out, improve the documentation.
>
> Link: https://lore.kernel.org/lkml/d25b1447-c28b-4998-b238-92672434dc28@lunn.ch/ [1]
> Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
> ---
> .../bindings/net/ethernet-controller.yaml | 16 +++++++++-------
> 1 file changed, 9 insertions(+), 7 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/net/ethernet-controller.yaml b/Documentation/devicetree/bindings/net/ethernet-controller.yaml
> index 45819b2358002..2ddc1ce2439a6 100644
> --- a/Documentation/devicetree/bindings/net/ethernet-controller.yaml
> +++ b/Documentation/devicetree/bindings/net/ethernet-controller.yaml
> @@ -74,19 +74,21 @@ properties:
> - rev-rmii
> - moca
>
> - # RX and TX delays are added by the MAC when required
> + # RX and TX delays are part of the board design (through PCB traces). MAC
> + # and PHY must not add delays.
> - rgmii
>
> - # RGMII with internal RX and TX delays provided by the PHY,
> - # the MAC should not add the RX or TX delays in this case
> + # RGMII with internal RX and TX delays provided by the MAC or PHY. No
> + # delays are included in the board design; this is the most common case
> + # in modern designs.
> - rgmii-id
>
> - # RGMII with internal RX delay provided by the PHY, the MAC
> - # should not add an RX delay in this case
> + # RGMII with internal RX delay provided by the MAC or PHY. TX delay is
> + # part of the board design.
> - rgmii-rxid
>
> - # RGMII with internal TX delay provided by the PHY, the MAC
> - # should not add an TX delay in this case
> + # RGMII with internal TX delay provided by the MAC or PHY. RX delay is
> + # part of the board design.
This looks good to me. There is nothing here which is Linux specific.
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Andrew
^ permalink raw reply [flat|nested] 47+ messages in thread
* Re: [PATCH net-next 1/4] dt-bindings: net: ethernet-controller: update descriptions of RGMII modes
2025-04-15 10:18 ` [PATCH net-next 1/4] dt-bindings: net: ethernet-controller: update descriptions of RGMII modes Matthias Schiffer
` (2 preceding siblings ...)
2025-04-18 20:26 ` Andrew Lunn
@ 2025-04-21 18:42 ` Rob Herring (Arm)
2025-04-21 19:20 ` Russell King (Oracle)
4 siblings, 0 replies; 47+ messages in thread
From: Rob Herring (Arm) @ 2025-04-21 18:42 UTC (permalink / raw)
To: Matthias Schiffer
Cc: linux-kernel, Conor Dooley, linux-arm-kernel, Andy Whitcroft,
Joe Perches, Nishanth Menon, David S. Miller, Jonathan Corbet,
Andrew Lunn, netdev, Eric Dumazet, Dwaipayan Ray, Roger Quadros,
Tero Kristo, Vignesh Raghavendra, Jakub Kicinski, Lukas Bulwahn,
Siddharth Vadapalli, devicetree, Krzysztof Kozlowski, Paolo Abeni,
linux, linux-doc
On Tue, 15 Apr 2025 12:18:01 +0200, Matthias Schiffer wrote:
> As discussed [1], the comments for the different rgmii(-*id) modes do not
> accurately describe what these values mean.
>
> As the Device Tree is primarily supposed to describe the hardware and not
> its configuration, the different modes need to distinguish board designs
> (if a delay is built into the PCB using different trace lengths); whether
> a delay is added on the MAC or the PHY side when needed should not matter.
>
> Unfortunately, implementation in MAC drivers is somewhat inconsistent
> where a delay is fixed or configurable on the MAC side. As a first step
> towards sorting this out, improve the documentation.
>
> Link: https://lore.kernel.org/lkml/d25b1447-c28b-4998-b238-92672434dc28@lunn.ch/ [1]
> Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
> ---
> .../bindings/net/ethernet-controller.yaml | 16 +++++++++-------
> 1 file changed, 9 insertions(+), 7 deletions(-)
>
Acked-by: Rob Herring (Arm) <robh@kernel.org>
^ permalink raw reply [flat|nested] 47+ messages in thread
* Re: [PATCH net-next 1/4] dt-bindings: net: ethernet-controller: update descriptions of RGMII modes
2025-04-15 10:18 ` [PATCH net-next 1/4] dt-bindings: net: ethernet-controller: update descriptions of RGMII modes Matthias Schiffer
` (3 preceding siblings ...)
2025-04-21 18:42 ` Rob Herring (Arm)
@ 2025-04-21 19:20 ` Russell King (Oracle)
2025-04-22 15:00 ` Andrew Lunn
4 siblings, 1 reply; 47+ messages in thread
From: Russell King (Oracle) @ 2025-04-21 19:20 UTC (permalink / raw)
To: Matthias Schiffer
Cc: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Andy Whitcroft, Dwaipayan Ray, Lukas Bulwahn, Joe Perches,
Jonathan Corbet, Nishanth Menon, Vignesh Raghavendra,
Siddharth Vadapalli, Roger Quadros, Tero Kristo, linux-doc,
linux-kernel, netdev, devicetree, linux-arm-kernel, linux
On Tue, Apr 15, 2025 at 12:18:01PM +0200, Matthias Schiffer wrote:
> diff --git a/Documentation/devicetree/bindings/net/ethernet-controller.yaml b/Documentation/devicetree/bindings/net/ethernet-controller.yaml
> index 45819b2358002..2ddc1ce2439a6 100644
> --- a/Documentation/devicetree/bindings/net/ethernet-controller.yaml
> +++ b/Documentation/devicetree/bindings/net/ethernet-controller.yaml
> @@ -74,19 +74,21 @@ properties:
> - rev-rmii
> - moca
>
> - # RX and TX delays are added by the MAC when required
> + # RX and TX delays are part of the board design (through PCB traces). MAC
> + # and PHY must not add delays.
> - rgmii
>
> - # RGMII with internal RX and TX delays provided by the PHY,
> - # the MAC should not add the RX or TX delays in this case
> + # RGMII with internal RX and TX delays provided by the MAC or PHY. No
> + # delays are included in the board design; this is the most common case
> + # in modern designs.
> - rgmii-id
>
> - # RGMII with internal RX delay provided by the PHY, the MAC
> - # should not add an RX delay in this case
> + # RGMII with internal RX delay provided by the MAC or PHY. TX delay is
> + # part of the board design.
> - rgmii-rxid
>
> - # RGMII with internal TX delay provided by the PHY, the MAC
> - # should not add an TX delay in this case
> + # RGMII with internal TX delay provided by the MAC or PHY. RX delay is
> + # part of the board design.
> - rgmii-txid
> - rtbi
> - smii
Sorry, but I don't think this wording improves the situation - in fact,
I think it makes the whole thing way more confusing.
Scenario 1: I'm a network device driver author. I read the above, Okay,
I have a RGMII interface, but I need delays to be added. I'll detect
when RGMII-ID is used, and cause the MAC driver to add the delays, but
still pass PHY_INTERFACE_MODE_RGMII_ID to phylib.
Scenario 2: I'm writing a DT file for a board. Hmm, so if I specify
rgmii because the delays are implemented in the traces, but I need to
fine-tune them. However, the documentation says that delays must not
be added by the MAC or the PHY so how do I adjust them. I know, I'll
use rgmii-id because that allows delays!
I suspect neither of these two are really want you mean, but given
this wording, that's exactly where it leads - which is more
confusion and less proper understanding.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
^ permalink raw reply [flat|nested] 47+ messages in thread
* Re: [PATCH net-next 1/4] dt-bindings: net: ethernet-controller: update descriptions of RGMII modes
2025-04-21 19:20 ` Russell King (Oracle)
@ 2025-04-22 15:00 ` Andrew Lunn
2025-04-22 15:31 ` Russell King (Oracle)
0 siblings, 1 reply; 47+ messages in thread
From: Andrew Lunn @ 2025-04-22 15:00 UTC (permalink / raw)
To: Russell King (Oracle)
Cc: Matthias Schiffer, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Andy Whitcroft, Dwaipayan Ray, Lukas Bulwahn,
Joe Perches, Jonathan Corbet, Nishanth Menon, Vignesh Raghavendra,
Siddharth Vadapalli, Roger Quadros, Tero Kristo, linux-doc,
linux-kernel, netdev, devicetree, linux-arm-kernel, linux
On Mon, Apr 21, 2025 at 08:20:29PM +0100, Russell King (Oracle) wrote:
> On Tue, Apr 15, 2025 at 12:18:01PM +0200, Matthias Schiffer wrote:
> > diff --git a/Documentation/devicetree/bindings/net/ethernet-controller.yaml b/Documentation/devicetree/bindings/net/ethernet-controller.yaml
> > index 45819b2358002..2ddc1ce2439a6 100644
> > --- a/Documentation/devicetree/bindings/net/ethernet-controller.yaml
> > +++ b/Documentation/devicetree/bindings/net/ethernet-controller.yaml
> > @@ -74,19 +74,21 @@ properties:
> > - rev-rmii
> > - moca
> >
> > - # RX and TX delays are added by the MAC when required
> > + # RX and TX delays are part of the board design (through PCB traces). MAC
> > + # and PHY must not add delays.
> > - rgmii
> >
> > - # RGMII with internal RX and TX delays provided by the PHY,
> > - # the MAC should not add the RX or TX delays in this case
> > + # RGMII with internal RX and TX delays provided by the MAC or PHY. No
> > + # delays are included in the board design; this is the most common case
> > + # in modern designs.
> > - rgmii-id
> >
> > - # RGMII with internal RX delay provided by the PHY, the MAC
> > - # should not add an RX delay in this case
> > + # RGMII with internal RX delay provided by the MAC or PHY. TX delay is
> > + # part of the board design.
> > - rgmii-rxid
> >
> > - # RGMII with internal TX delay provided by the PHY, the MAC
> > - # should not add an TX delay in this case
> > + # RGMII with internal TX delay provided by the MAC or PHY. RX delay is
> > + # part of the board design.
> > - rgmii-txid
> > - rtbi
> > - smii
>
> Sorry, but I don't think this wording improves the situation - in fact,
> I think it makes the whole thing way more confusing.
>
> Scenario 1: I'm a network device driver author. I read the above, Okay,
> I have a RGMII interface, but I need delays to be added. I'll detect
> when RGMII-ID is used, and cause the MAC driver to add the delays, but
> still pass PHY_INTERFACE_MODE_RGMII_ID to phylib.
>
> Scenario 2: I'm writing a DT file for a board. Hmm, so if I specify
> rgmii because the delays are implemented in the traces, but I need to
> fine-tune them. However, the documentation says that delays must not
> be added by the MAC or the PHY so how do I adjust them. I know, I'll
> use rgmii-id because that allows delays!
>
> I suspect neither of these two are really want you mean, but given
> this wording, that's exactly where it leads - which is more
> confusion and less proper understanding.
These DT documents are supposed to be normative and OS agnostic. I
wounder what the DT Maintainers will say if we add an Informative
section afterwards giving a detailed description of how Linux actually
implements these normative statements? It will need to open with a
clear statement that it is describing Linux behaviour, and other OSes
can implement the normative part in other ways and still be compliant,
but that Linux has seen a lot of broken implementations and so wants
to add Informative information to guide Linux developers.
Andrew
^ permalink raw reply [flat|nested] 47+ messages in thread
* Re: [PATCH net-next 1/4] dt-bindings: net: ethernet-controller: update descriptions of RGMII modes
2025-04-22 15:00 ` Andrew Lunn
@ 2025-04-22 15:31 ` Russell King (Oracle)
2025-04-28 11:29 ` Matthias Schiffer
0 siblings, 1 reply; 47+ messages in thread
From: Russell King (Oracle) @ 2025-04-22 15:31 UTC (permalink / raw)
To: Andrew Lunn
Cc: Matthias Schiffer, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Andy Whitcroft, Dwaipayan Ray, Lukas Bulwahn,
Joe Perches, Jonathan Corbet, Nishanth Menon, Vignesh Raghavendra,
Siddharth Vadapalli, Roger Quadros, Tero Kristo, linux-doc,
linux-kernel, netdev, devicetree, linux-arm-kernel, linux
On Tue, Apr 22, 2025 at 05:00:37PM +0200, Andrew Lunn wrote:
> On Mon, Apr 21, 2025 at 08:20:29PM +0100, Russell King (Oracle) wrote:
> > On Tue, Apr 15, 2025 at 12:18:01PM +0200, Matthias Schiffer wrote:
> > > diff --git a/Documentation/devicetree/bindings/net/ethernet-controller.yaml b/Documentation/devicetree/bindings/net/ethernet-controller.yaml
> > > index 45819b2358002..2ddc1ce2439a6 100644
> > > --- a/Documentation/devicetree/bindings/net/ethernet-controller.yaml
> > > +++ b/Documentation/devicetree/bindings/net/ethernet-controller.yaml
> > > @@ -74,19 +74,21 @@ properties:
> > > - rev-rmii
> > > - moca
> > >
> > > - # RX and TX delays are added by the MAC when required
> > > + # RX and TX delays are part of the board design (through PCB traces). MAC
> > > + # and PHY must not add delays.
> > > - rgmii
> > >
> > > - # RGMII with internal RX and TX delays provided by the PHY,
> > > - # the MAC should not add the RX or TX delays in this case
> > > + # RGMII with internal RX and TX delays provided by the MAC or PHY. No
> > > + # delays are included in the board design; this is the most common case
> > > + # in modern designs.
> > > - rgmii-id
> > >
> > > - # RGMII with internal RX delay provided by the PHY, the MAC
> > > - # should not add an RX delay in this case
> > > + # RGMII with internal RX delay provided by the MAC or PHY. TX delay is
> > > + # part of the board design.
> > > - rgmii-rxid
> > >
> > > - # RGMII with internal TX delay provided by the PHY, the MAC
> > > - # should not add an TX delay in this case
> > > + # RGMII with internal TX delay provided by the MAC or PHY. RX delay is
> > > + # part of the board design.
> > > - rgmii-txid
> > > - rtbi
> > > - smii
> >
> > Sorry, but I don't think this wording improves the situation - in fact,
> > I think it makes the whole thing way more confusing.
> >
> > Scenario 1: I'm a network device driver author. I read the above, Okay,
> > I have a RGMII interface, but I need delays to be added. I'll detect
> > when RGMII-ID is used, and cause the MAC driver to add the delays, but
> > still pass PHY_INTERFACE_MODE_RGMII_ID to phylib.
> >
> > Scenario 2: I'm writing a DT file for a board. Hmm, so if I specify
> > rgmii because the delays are implemented in the traces, but I need to
> > fine-tune them. However, the documentation says that delays must not
> > be added by the MAC or the PHY so how do I adjust them. I know, I'll
> > use rgmii-id because that allows delays!
> >
> > I suspect neither of these two are really want you mean, but given
> > this wording, that's exactly where it leads - which is more
> > confusion and less proper understanding.
>
> These DT documents are supposed to be normative and OS agnostic. I
> wounder what the DT Maintainers will say if we add an Informative
> section afterwards giving a detailed description of how Linux actually
> implements these normative statements? It will need to open with a
> clear statement that it is describing Linux behaviour, and other OSes
> can implement the normative part in other ways and still be compliant,
> but that Linux has seen a lot of broken implementations and so wants
> to add Informative information to guide Linux developers.
Well, looking at ePAPR, the only thing that was defined back then was
the presence of a property to describe the interface type between the
ethernet device and PHY. The values were left to the implementation
to decide upon, but with some recommendations.
What that means is that the values to this property are not part of
the DT standard, but are a matter for the implementation.
However, with the yaml stuff, if that is basically becoming "DT
specification" then it needs to be clearly defined what each value
actually means for the system, and not this vague airy-fairy thing
we have now.
We've learnt the hard way in the kernel where that gets us with
the number of back-compat breaking changes we've had to make where
the RGMII delays have been totally wrongly interpreted and leaving
it vague means that other implementations will suffer the same pain.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
^ permalink raw reply [flat|nested] 47+ messages in thread
* Re: [PATCH net-next 1/4] dt-bindings: net: ethernet-controller: update descriptions of RGMII modes
2025-04-22 15:31 ` Russell King (Oracle)
@ 2025-04-28 11:29 ` Matthias Schiffer
2025-04-28 14:08 ` Andrew Lunn
0 siblings, 1 reply; 47+ messages in thread
From: Matthias Schiffer @ 2025-04-28 11:29 UTC (permalink / raw)
To: Russell King (Oracle), Andrew Lunn
Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Andy Whitcroft,
Dwaipayan Ray, Lukas Bulwahn, Joe Perches, Jonathan Corbet,
Nishanth Menon, Vignesh Raghavendra, Siddharth Vadapalli,
Roger Quadros, Tero Kristo, linux-doc, linux-kernel, netdev,
devicetree, linux-arm-kernel, linux
On Tue, 2025-04-22 at 16:31 +0100, Russell King (Oracle) wrote:
> ********************
> Achtung externe E-Mail: Öffnen Sie Anhänge und Links nur, wenn Sie wissen, dass diese aus einer sicheren Quelle stammen und sicher sind. Leiten Sie die E-Mail im Zweifelsfall zur Prüfung an den IT-Helpdesk weiter.
> Attention external email: Open attachments and links only if you know that they are from a secure source and are safe. In doubt forward the email to the IT-Helpdesk to check it.
> ********************
>
> On Tue, Apr 22, 2025 at 05:00:37PM +0200, Andrew Lunn wrote:
> > On Mon, Apr 21, 2025 at 08:20:29PM +0100, Russell King (Oracle) wrote:
> > > On Tue, Apr 15, 2025 at 12:18:01PM +0200, Matthias Schiffer wrote:
> > > > diff --git a/Documentation/devicetree/bindings/net/ethernet-controller.yaml b/Documentation/devicetree/bindings/net/ethernet-controller.yaml
> > > > index 45819b2358002..2ddc1ce2439a6 100644
> > > > --- a/Documentation/devicetree/bindings/net/ethernet-controller.yaml
> > > > +++ b/Documentation/devicetree/bindings/net/ethernet-controller.yaml
> > > > @@ -74,19 +74,21 @@ properties:
> > > > - rev-rmii
> > > > - moca
> > > >
> > > > - # RX and TX delays are added by the MAC when required
> > > > + # RX and TX delays are part of the board design (through PCB traces). MAC
> > > > + # and PHY must not add delays.
> > > > - rgmii
> > > >
> > > > - # RGMII with internal RX and TX delays provided by the PHY,
> > > > - # the MAC should not add the RX or TX delays in this case
> > > > + # RGMII with internal RX and TX delays provided by the MAC or PHY. No
> > > > + # delays are included in the board design; this is the most common case
> > > > + # in modern designs.
> > > > - rgmii-id
> > > >
> > > > - # RGMII with internal RX delay provided by the PHY, the MAC
> > > > - # should not add an RX delay in this case
> > > > + # RGMII with internal RX delay provided by the MAC or PHY. TX delay is
> > > > + # part of the board design.
> > > > - rgmii-rxid
> > > >
> > > > - # RGMII with internal TX delay provided by the PHY, the MAC
> > > > - # should not add an TX delay in this case
> > > > + # RGMII with internal TX delay provided by the MAC or PHY. RX delay is
> > > > + # part of the board design.
> > > > - rgmii-txid
> > > > - rtbi
> > > > - smii
> > >
> > > Sorry, but I don't think this wording improves the situation - in fact,
> > > I think it makes the whole thing way more confusing.
> > >
> > > Scenario 1: I'm a network device driver author. I read the above, Okay,
> > > I have a RGMII interface, but I need delays to be added. I'll detect
> > > when RGMII-ID is used, and cause the MAC driver to add the delays, but
> > > still pass PHY_INTERFACE_MODE_RGMII_ID to phylib.
> > >
> > > Scenario 2: I'm writing a DT file for a board. Hmm, so if I specify
> > > rgmii because the delays are implemented in the traces, but I need to
> > > fine-tune them. However, the documentation says that delays must not
> > > be added by the MAC or the PHY so how do I adjust them. I know, I'll
> > > use rgmii-id because that allows delays!
> > >
> > > I suspect neither of these two are really want you mean, but given
> > > this wording, that's exactly where it leads - which is more
> > > confusion and less proper understanding.
> >
> > These DT documents are supposed to be normative and OS agnostic. I
> > wounder what the DT Maintainers will say if we add an Informative
> > section afterwards giving a detailed description of how Linux actually
> > implements these normative statements? It will need to open with a
> > clear statement that it is describing Linux behaviour, and other OSes
> > can implement the normative part in other ways and still be compliant,
> > but that Linux has seen a lot of broken implementations and so wants
> > to add Informative information to guide Linux developers.
>
> Well, looking at ePAPR, the only thing that was defined back then was
> the presence of a property to describe the interface type between the
> ethernet device and PHY. The values were left to the implementation
> to decide upon, but with some recommendations.
>
> What that means is that the values to this property are not part of
> the DT standard, but are a matter for the implementation.
>
> However, with the yaml stuff, if that is basically becoming "DT
> specification" then it needs to be clearly defined what each value
> actually means for the system, and not this vague airy-fairy thing
> we have now.
>
> We've learnt the hard way in the kernel where that gets us with
> the number of back-compat breaking changes we've had to make where
> the RGMII delays have been totally wrongly interpreted and leaving
> it vague means that other implementations will suffer the same pain.
I agree with Russell that it seems preferable to make it unambiguous whether
delays are added on the MAC or PHY side, in particular for fine-tuning. If
anything is left to the implementation, we should make the range of acceptable
driver behavior very clear in the documentation.
Historically, there appear to exist at least 4 different ways to handle the
RGMII modes in MAC drivers:
(I'm using the terms "id" and "noid" in the following to refer to modes with and
without delays independently of the direction; a single driver may fall into
different categories for the RX and TX side)
1) MAC ignores the mode, does not add delays, passes the mode to the PHY
- Mode "noid" is used when delays are added by the PCB
- PHY sees the same interface mode that is specified in the DT
- Does not match the old wording of the DT binding docs (as the MAC never adds
delays)
2) MAC adds delays in "noid" mode, passes the mode to the PHY unchanged
- Delays added by the PCB can only be supported via driver-specific
fine-tuning properties on the MAC or PHY side
- Without driver-specific properties, none of the modes allow for delays on
the PCB; every mode adds delays either on the MAC or the PHY side
- PHY sees the same interface mode that is specified in the DT
- Matches the old wording of the DT binding docs (which don't allow for delays
added by the PCB)
3) MAC has a fixed delay, but also passes the interface mode unchanged to the
PHY (example: TX delays in TI CPSW AM65)
- No support for delays on the PCB due to hardware limitation
- PHY sees the same interface mode that is specified in the DT
- For the direction in which the delays are added by the MAC, you need to
specify "noid" in the DT even though there is an internal delay
4) MAC adds delays in "id" mode and fixes it up so "noid" is passed to
the PHY (example: TX delays in TI ICSSG)
- No support for delays on the PCB due to hardware limitation
- PHY does NOT see the same interface mode that is specified in the DT
- Fine-tuning options may be confusing because of the fixup
Of all of these variants:
- 1 and 2 appear to be most common in existing MAC drivers
- 2 and maybe 3 match the old wording of the DT binding docs
- 1, 2 and 3 pass the interface mode unchanged to the PHY
- 1 and 4 match my proposed new wording of the DT binding docs based on Andrew's
input
- 1 allows for designs that have a delay on the PCB without driver-specific
fine-tuning
- 2 and maybe 3 and 4 allow for designs where the PHY can't add delays and none
exist on the PCB (or there is no PHY - could be two SoCs directly connected
via RGMII, or a switch IC we can't control)
And of course, things become even more muddled when driver-specific properties
for fine-tuning etc. are involved.
Any change to existing drivers will need to be made in a backwards-compatible
way, meaning that we can't break compatibility with old Device Trees. If we
somehow want to clean up this mess, and also support delays on the PCB, designs
without (configurable) PHY, and unambiguously specify where delays are added, I
don't think the existing rgmii(-*id) modes are going to suffice. I think
something along the lines of the following might be a possible way forward:
- Introduce new DT properties to specify whether delays should be added on the
MAC or PHY side, for RX and TX independently. Could also replace some driver-
specific fine-tuning properties.
- In the presence of the new properties, only "rgmii" can be specified as phy-
mode, the delays are not part of the PHY mode property anymore
- MAC and PHY drivers must reject delay configurations they can't satisfy
- Not specifying the new properties results in a deprecation warning on existing
drivers. New drivers make the new properties mandatory.
- Not specifying the new properties causes drivers to interpret "rgmii(-*id)"
however they have done in the past to maintain backwards compatibility
Implementation of the new properties would need to be done in a way that allows
MAC and PHY drivers to be converted one by one, and to only print deprecation
warnings asking for the DT to be fixed once the conversion has been done.
Attempting to specify the new properties when not both MAC and PHY driver
support them must be rejected, so the drivers gaining support for them can't
result in a breaking change.
I would be very happy to hear some feedback on these ideas - of course,
alternative ideas that are easier to implement would be even more welcome...
Best,
Matthias
--
TQ-Systems GmbH | Mühlstraße 2, Gut Delling | 82229 Seefeld, Germany
Amtsgericht München, HRB 105018
Geschäftsführer: Detlef Schneider, Rüdiger Stahl, Stefan Schneider
https://www.tq-group.com/
^ permalink raw reply [flat|nested] 47+ messages in thread
* Re: [PATCH net-next 1/4] dt-bindings: net: ethernet-controller: update descriptions of RGMII modes
2025-04-28 11:29 ` Matthias Schiffer
@ 2025-04-28 14:08 ` Andrew Lunn
2025-04-28 14:28 ` Siddharth Vadapalli
2025-04-29 7:24 ` Matthias Schiffer
0 siblings, 2 replies; 47+ messages in thread
From: Andrew Lunn @ 2025-04-28 14:08 UTC (permalink / raw)
To: Matthias Schiffer
Cc: Russell King (Oracle), David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Andy Whitcroft, Dwaipayan Ray, Lukas Bulwahn,
Joe Perches, Jonathan Corbet, Nishanth Menon, Vignesh Raghavendra,
Siddharth Vadapalli, Roger Quadros, Tero Kristo, linux-doc,
linux-kernel, netdev, devicetree, linux-arm-kernel, linux
> > However, with the yaml stuff, if that is basically becoming "DT
> > specification" then it needs to be clearly defined what each value
> > actually means for the system, and not this vague airy-fairy thing
> > we have now.
> I agree with Russell that it seems preferable to make it unambiguous whether
> delays are added on the MAC or PHY side, in particular for fine-tuning. If
> anything is left to the implementation, we should make the range of acceptable
> driver behavior very clear in the documentation.
I think we should try the "Informative" route first, see what the DT
Maintainers think when we describe in detail how Linux interprets
these values.
I don't think a whole new set of properties will solve anything. I
would say the core of the problem is that there are multiple ways of
getting a working system, many of which don't fit the DT binding. But
DT developers don't care about that, they are just happy when it
works. Adding a different set of properties won't change that.
Andrew
^ permalink raw reply [flat|nested] 47+ messages in thread
* Re: [PATCH net-next 1/4] dt-bindings: net: ethernet-controller: update descriptions of RGMII modes
2025-04-28 14:08 ` Andrew Lunn
@ 2025-04-28 14:28 ` Siddharth Vadapalli
2025-04-28 14:45 ` Andrew Lunn
2025-04-29 7:24 ` Matthias Schiffer
1 sibling, 1 reply; 47+ messages in thread
From: Siddharth Vadapalli @ 2025-04-28 14:28 UTC (permalink / raw)
To: Andrew Lunn
Cc: Matthias Schiffer, Russell King (Oracle), David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Andy Whitcroft, Dwaipayan Ray,
Lukas Bulwahn, Joe Perches, Jonathan Corbet, Nishanth Menon,
Vignesh Raghavendra, Siddharth Vadapalli, Roger Quadros,
Tero Kristo, linux-doc, linux-kernel, netdev, devicetree,
linux-arm-kernel, linux
On Mon, Apr 28, 2025 at 04:08:10PM +0200, Andrew Lunn wrote:
> > > However, with the yaml stuff, if that is basically becoming "DT
> > > specification" then it needs to be clearly defined what each value
> > > actually means for the system, and not this vague airy-fairy thing
> > > we have now.
>
>
> > I agree with Russell that it seems preferable to make it unambiguous whether
> > delays are added on the MAC or PHY side, in particular for fine-tuning. If
> > anything is left to the implementation, we should make the range of acceptable
> > driver behavior very clear in the documentation.
>
> I think we should try the "Informative" route first, see what the DT
> Maintainers think when we describe in detail how Linux interprets
> these values.
>
> I don't think a whole new set of properties will solve anything. I
> would say the core of the problem is that there are multiple ways of
> getting a working system, many of which don't fit the DT binding. But
> DT developers don't care about that, they are just happy when it
> works. Adding a different set of properties won't change that.
Isn't the ambiguity arising due to an incomplete description wherein we
are not having an accurate description for the PCB Traces?
A complete description might be something like:
mac {
pcb-traces {
mac-to-phy-trace-delay = <X>; // Nanoseconds
phy-to-mac-trace-delay = <Y>; // Nanoseconds
};
phy-mode = "rgmii-*";
phy-handle = <&phy>;
};
In some designs, the "mac-to-phy-trace" and the "phy-to-mac-trace" are
treated as a part of the MAC block for example. Depending on which block
contains the trace, the delay is added accordingly.
Regards,
Siddharth.
^ permalink raw reply [flat|nested] 47+ messages in thread
* Re: [PATCH net-next 1/4] dt-bindings: net: ethernet-controller: update descriptions of RGMII modes
2025-04-28 14:28 ` Siddharth Vadapalli
@ 2025-04-28 14:45 ` Andrew Lunn
0 siblings, 0 replies; 47+ messages in thread
From: Andrew Lunn @ 2025-04-28 14:45 UTC (permalink / raw)
To: Siddharth Vadapalli
Cc: Matthias Schiffer, Russell King (Oracle), David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Andy Whitcroft, Dwaipayan Ray,
Lukas Bulwahn, Joe Perches, Jonathan Corbet, Nishanth Menon,
Vignesh Raghavendra, Roger Quadros, Tero Kristo, linux-doc,
linux-kernel, netdev, devicetree, linux-arm-kernel, linux
> A complete description might be something like:
>
> mac {
> pcb-traces {
> mac-to-phy-trace-delay = <X>; // Nanoseconds
> phy-to-mac-trace-delay = <Y>; // Nanoseconds
> };
> In some designs, the "mac-to-phy-trace" and the "phy-to-mac-trace" are
> treated as a part of the MAC block for example.
PCB traces cannot be part of the MAC block, since they are copper on
the PCB. In fact, such a consideration just adds to the confusion,
because how do you know which designs do and which don't include the
MAC block?
Andrew
^ permalink raw reply [flat|nested] 47+ messages in thread
* Re: [PATCH net-next 1/4] dt-bindings: net: ethernet-controller: update descriptions of RGMII modes
2025-04-28 14:08 ` Andrew Lunn
2025-04-28 14:28 ` Siddharth Vadapalli
@ 2025-04-29 7:24 ` Matthias Schiffer
2025-04-29 12:08 ` Andrew Lunn
1 sibling, 1 reply; 47+ messages in thread
From: Matthias Schiffer @ 2025-04-29 7:24 UTC (permalink / raw)
To: Andrew Lunn
Cc: Russell King (Oracle), David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Andy Whitcroft, Dwaipayan Ray, Lukas Bulwahn,
Joe Perches, Jonathan Corbet, Nishanth Menon, Vignesh Raghavendra,
Siddharth Vadapalli, Roger Quadros, Tero Kristo, linux-doc,
linux-kernel, netdev, devicetree, linux-arm-kernel, linux
On Mon, 2025-04-28 at 16:08 +0200, Andrew Lunn wrote:
>
> > > However, with the yaml stuff, if that is basically becoming "DT
> > > specification" then it needs to be clearly defined what each value
> > > actually means for the system, and not this vague airy-fairy thing
> > > we have now.
>
>
> > I agree with Russell that it seems preferable to make it unambiguous whether
> > delays are added on the MAC or PHY side, in particular for fine-tuning. If
> > anything is left to the implementation, we should make the range of acceptable
> > driver behavior very clear in the documentation.
>
> I think we should try the "Informative" route first, see what the DT
> Maintainers think when we describe in detail how Linux interprets
> these values.
Oh, we should not be Linux-specific. We should describe in detail how *any OS*
must interpret values.
>
> I don't think a whole new set of properties will solve anything. I
> would say the core of the problem is that there are multiple ways of
> getting a working system, many of which don't fit the DT binding. But
> DT developers don't care about that, they are just happy when it
> works. Adding a different set of properties won't change that.
>
> Andrew
Hmm, considering that
- interpretation of existing properties is inconsistent
- we could like something with a consistent interpretation
- we can't change how existing drivers interpret the properties, as that would
be a breaking change,
I don't think we really have any options but to introduce something new, or keep
the inconsistent status quo.
Best,
Matthias
--
TQ-Systems GmbH | Mühlstraße 2, Gut Delling | 82229 Seefeld, Germany
Amtsgericht München, HRB 105018
Geschäftsführer: Detlef Schneider, Rüdiger Stahl, Stefan Schneider
https://www.tq-group.com/
^ permalink raw reply [flat|nested] 47+ messages in thread
* Re: [PATCH net-next 1/4] dt-bindings: net: ethernet-controller: update descriptions of RGMII modes
2025-04-29 7:24 ` Matthias Schiffer
@ 2025-04-29 12:08 ` Andrew Lunn
2025-04-30 7:33 ` Matthias Schiffer
0 siblings, 1 reply; 47+ messages in thread
From: Andrew Lunn @ 2025-04-29 12:08 UTC (permalink / raw)
To: Matthias Schiffer
Cc: Russell King (Oracle), David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Andy Whitcroft, Dwaipayan Ray, Lukas Bulwahn,
Joe Perches, Jonathan Corbet, Nishanth Menon, Vignesh Raghavendra,
Siddharth Vadapalli, Roger Quadros, Tero Kristo, linux-doc,
linux-kernel, netdev, devicetree, linux-arm-kernel, linux
On Tue, Apr 29, 2025 at 09:24:49AM +0200, Matthias Schiffer wrote:
> On Mon, 2025-04-28 at 16:08 +0200, Andrew Lunn wrote:
> >
> > > > However, with the yaml stuff, if that is basically becoming "DT
> > > > specification" then it needs to be clearly defined what each value
> > > > actually means for the system, and not this vague airy-fairy thing
> > > > we have now.
> >
> >
> > > I agree with Russell that it seems preferable to make it unambiguous whether
> > > delays are added on the MAC or PHY side, in particular for fine-tuning. If
> > > anything is left to the implementation, we should make the range of acceptable
> > > driver behavior very clear in the documentation.
> >
> > I think we should try the "Informative" route first, see what the DT
> > Maintainers think when we describe in detail how Linux interprets
> > these values.
>
> Oh, we should not be Linux-specific. We should describe in detail how *any OS*
> must interpret values.
There is two things here. One is related to delays on the PCB. Those
are OS agnostic and clearly you are describing hardware. But once you
get to implementing the delay in the MAC or the PHY, it is policy if
the PHY does it, or the MAC does it. Different OSes can have different
policy. We cannot force other OSes to do the same as Linux.
I drafted some text last night. I need to review it because i often
make typos, and then i will post it.
Andrew
^ permalink raw reply [flat|nested] 47+ messages in thread
* Re: [PATCH net-next 1/4] dt-bindings: net: ethernet-controller: update descriptions of RGMII modes
2025-04-29 12:08 ` Andrew Lunn
@ 2025-04-30 7:33 ` Matthias Schiffer
0 siblings, 0 replies; 47+ messages in thread
From: Matthias Schiffer @ 2025-04-30 7:33 UTC (permalink / raw)
To: Andrew Lunn
Cc: Russell King (Oracle), David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Andy Whitcroft, Dwaipayan Ray, Lukas Bulwahn,
Joe Perches, Jonathan Corbet, Nishanth Menon, Vignesh Raghavendra,
Siddharth Vadapalli, Roger Quadros, Tero Kristo, linux-doc,
linux-kernel, netdev, devicetree, linux-arm-kernel, linux
On Tue, 2025-04-29 at 14:08 +0200, Andrew Lunn wrote:
> On Tue, Apr 29, 2025 at 09:24:49AM +0200, Matthias Schiffer wrote:
> > On Mon, 2025-04-28 at 16:08 +0200, Andrew Lunn wrote:
> > >
> > > > > However, with the yaml stuff, if that is basically becoming "DT
> > > > > specification" then it needs to be clearly defined what each value
> > > > > actually means for the system, and not this vague airy-fairy thing
> > > > > we have now.
> > >
> > >
> > > > I agree with Russell that it seems preferable to make it unambiguous whether
> > > > delays are added on the MAC or PHY side, in particular for fine-tuning. If
> > > > anything is left to the implementation, we should make the range of acceptable
> > > > driver behavior very clear in the documentation.
> > >
> > > I think we should try the "Informative" route first, see what the DT
> > > Maintainers think when we describe in detail how Linux interprets
> > > these values.
> >
> > Oh, we should not be Linux-specific. We should describe in detail how *any OS*
> > must interpret values.
>
> There is two things here. One is related to delays on the PCB. Those
> are OS agnostic and clearly you are describing hardware. But once you
> get to implementing the delay in the MAC or the PHY, it is policy if
> the PHY does it, or the MAC does it. Different OSes can have different
> policy. We cannot force other OSes to do the same as Linux.
If we want to support fine-tuning properties and other driver-specific
attributes that rely on the specific delay mode used on the MAC or PHY side, we
must make this policy a part of the binding docs.
Also, we make decisions how DT bindings work in Linux all the time, and other OS
must implement them in the same way to be compatible with Device Trees using
these bindings. I don't see how in this case we suddenly can't make such a
decision.
>
> I drafted some text last night. I need to review it because i often
> make typos, and then i will post it.
Thanks, I'll give it a read later.
Best,
Matthias
--
TQ-Systems GmbH | Mühlstraße 2, Gut Delling | 82229 Seefeld, Germany
Amtsgericht München, HRB 105018
Geschäftsführer: Detlef Schneider, Rüdiger Stahl, Stefan Schneider
https://www.tq-group.com/
^ permalink raw reply [flat|nested] 47+ messages in thread