[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251027230439.7zsi3k6da3rohrfo@skbuf>
Date: Tue, 28 Oct 2025 01:04:39 +0200
From: Vladimir Oltean <olteanv@...il.com>
To: Daniel Golle <daniel@...rotopia.org>
Cc: Hauke Mehrtens <hauke@...ke-m.de>, Andrew Lunn <andrew@...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>, Simon Horman <horms@...nel.org>,
Russell King <linux@...linux.org.uk>, netdev@...r.kernel.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
Andreas Schirm <andreas.schirm@...mens.com>,
Lukas Stockmann <lukas.stockmann@...mens.com>,
Alexander Sverdlin <alexander.sverdlin@...mens.com>,
Peter Christen <peter.christen@...mens.com>,
Avinash Jayaraman <ajayaraman@...linear.com>,
Bing tao Xu <bxu@...linear.com>, Liang Xu <lxu@...linear.com>,
Juraj Povazanec <jpovazanec@...linear.com>,
"Fanni (Fang-Yi) Chan" <fchan@...linear.com>,
"Benny (Ying-Tsan) Weng" <yweng@...linear.com>,
"Livia M. Rosu" <lrosu@...linear.com>,
John Crispin <john@...ozen.org>
Subject: Re: [PATCH net-next v3 06/12] dt-bindings: net: dsa: lantiq,gswip:
add support for MII delay properties
On Sun, Oct 26, 2025 at 11:45:19PM +0000, Daniel Golle wrote:
> Add support for standard tx-internal-delay-ps and rx-internal-delay-ps
> properties on port nodes to allow fine-tuning of RGMII clock delays.
>
> The GSWIP switch hardware supports delay values in 500 picosecond
> increments from 0 to 3500 picoseconds, with a default of 2000
> picoseconds for both TX and RX delays.
>
> This corresponds to the driver changes that allow adjusting MII delays
> using Device Tree properties instead of relying solely on the PHY
> interface mode.
>
> Signed-off-by: Daniel Golle <daniel@...rotopia.org>
> ---
> v3:
> * redefine ports node so properties are defined actually apply
> * RGMII port with 2ps delay is 'rgmii-id' mode
>
> .../bindings/net/dsa/lantiq,gswip.yaml | 29 +++++++++++++++++--
> 1 file changed, 26 insertions(+), 3 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/net/dsa/lantiq,gswip.yaml b/Documentation/devicetree/bindings/net/dsa/lantiq,gswip.yaml
> index f3154b19af78..b0227b80716c 100644
> --- a/Documentation/devicetree/bindings/net/dsa/lantiq,gswip.yaml
> +++ b/Documentation/devicetree/bindings/net/dsa/lantiq,gswip.yaml
> @@ -6,8 +6,29 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
>
> title: Lantiq GSWIP Ethernet switches
>
> -allOf:
> - - $ref: dsa.yaml#/$defs/ethernet-ports
> +$ref: dsa.yaml#
> +
> +patternProperties:
> + "^(ethernet-)?ports$":
> + type: object
> + patternProperties:
> + "^(ethernet-)?port@[0-6]$":
> + $ref: dsa-port.yaml#
> + unevaluatedProperties: false
> +
> + properties:
> + tx-internal-delay-ps:
> + enum: [0, 500, 1000, 1500, 2000, 2500, 3000, 3500]
> + default: 2000
No. This is confusing and wrong. I looked at the driver implementation
code, wanting to note that it has the potential of being a breaking
change for device trees without the "tx-internal-delay-ps" and
"rx-internal-delay-ps" properties.
But then I saw that the driver implementation is subtly different.
"tx-internal-delay-ps" defaults to 2000 only if "rx-internal-delay-ps" is set, and
"rx-internal-delay-ps" defaults to 2000 only if "tx-internal-delay-ps" is set.
So when implemented in this way, it won't cause the regressions I was
concerned about, but it is misrepresented in the schema.
Why overcomplicate this and just not set a default? Modify the RX clock
skew if set, and the TX clock skew if set.
> + description:
> + RGMII TX Clock Delay defined in pico seconds.
> + The delay lines adjust the MII clock vs. data timing.
> + rx-internal-delay-ps:
> + enum: [0, 500, 1000, 1500, 2000, 2500, 3000, 3500]
> + default: 2000
> + description:
> + RGMII RX Clock Delay defined in pico seconds.
> + The delay lines adjust the MII clock vs. data timing.
>
> maintainers:
> - Hauke Mehrtens <hauke@...ke-m.de>
> @@ -113,8 +134,10 @@ examples:
> port@0 {
> reg = <0>;
> label = "lan3";
> - phy-mode = "rgmii";
> + phy-mode = "rgmii-id";
> phy-handle = <&phy0>;
> + tx-internal-delay-ps = <2000>;
> + rx-internal-delay-ps = <2000>;
> };
>
> port@1 {
> --
> 2.51.1
Powered by blists - more mailing lists