From: Jens Emil Schulz Ostergaard <jensemil.schulzostergaard@microchip.com>
To: <netdev-bot+sashiko@kernel.org>
Cc: <UNGLinuxDriver@microchip.com>, <andrew@lunn.ch>,
<olteanv@gmail.com>, <davem@davemloft.net>, <edumazet@google.com>,
<kuba@kernel.org>, <pabeni@redhat.com>, <horms@kernel.org>,
<robh@kernel.org>, <krzk+dt@kernel.org>, <conor+dt@kernel.org>,
<woojung.huh@microchip.com>, <linux@armlinux.org.uk>,
<Steen.Hegelund@microchip.com>, <daniel.machon@microchip.com>,
<geert+renesas@glider.be>, <magnus.damm@gmail.com>,
<linux-kernel@vger.kernel.org>, <netdev@vger.kernel.org>,
<devicetree@vger.kernel.org>, <linux-renesas-soc@vger.kernel.org>
Subject: Re: [PATCH net-next v13 2/9] dt-bindings: net: lan9645x: add LAN9645X switch bindings
Date: Wed, 7 Oct 2026 16:34:09 +0200 [thread overview]
Message-ID: <02cce6979c4902e75f2f9b94621f2f81e82b879a.camel@microchip.com> (raw)
In-Reply-To: <179097565632.434549.4502209637975152299@kernel.org>
On Fri, 2026-10-02 at 21:14 +0000, netdev-bot+sashiko@kernel.org wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
>
> Thank you for your contribution! Sashiko AI review found 3 potential
> issue(s) to consider.
>
> Critical: 0 · High: 0 · Medium: 1 · Low: 2
>
> If you believe none of the issues are legitimate, please reply to each
> issue of Medium severity or higher and explain why the AI is wrong.
> If any of them are legitimate and you plan to respin, please let patchwork
> know by including "pw-bot: cr" as a separate line at the end of your reply
> (one such reply per series is enough).
>
> - [Medium] The binding makes rx/tx-internal-delay-ps on the MAC-side
> switch port nodes an on/off switch for the full 2 ns RGMII delay…
> - [Low] The per-port pattern "^(ethernet-)?port@[0-8]$" in
> properties/ethernet-ports does not actually limit ports to the 9…
> - [Low] The subject "dt-bindings: net: lan9645x: add LAN9645X switch
> bindings" does not follow…
>
> --
>
> dt-bindings: net: lan9645x: add LAN9645X switch bindings
>
> This commit adds a DT binding for the Microchip LAN9645x DSA switch. The
> smallest SKU, microchip,lan96455s-switch, is the fallback compatible. The
> switch register targets are described through reg and reg-names, following
> mscc,vsc7514-switch.yaml.
>
> > dt-bindings: net: lan9645x: add LAN9645X switch bindings
>
> [Severity: Low]
> This isn't a bug, but the subject doesn't match what
> Documentation/devicetree/bindings/submitting-patches.rst asks for. That file
> says "Repeating "binding" again should also be avoided". Its example form is
> "dt-bindings: iio: adc: Add ROHM BD79100G".
>
> The file lives under net/dsa/, so the usual prefix is "dt-bindings: net: dsa:".
> Something like "dt-bindings: net: dsa: Add Microchip LAN9645x switch" would
> fit better.
>
I will retitle.
> > diff --git a/Documentation/devicetree/bindings/net/dsa/microchip,lan96455s-switch.yaml b/Documentation/devicetree/bindings/net/dsa/microchip,lan96455s-switch.yaml
> > new file mode 100644
> > index 0000000000000..9deb7a427804f
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/net/dsa/microchip,lan96455s-switch.yaml
>
> [ ... ]
>
> > + ethernet-ports:
> > + type: object
> > + additionalProperties: true
> > + patternProperties:
> > + "^(ethernet-)?port@[0-8]$":
>
> [Severity: Low]
> Does this pattern actually restrict port nodes to the 9 hardware ports
> (dev0..dev8)?
>
> ethernet-ports has additionalProperties: true, so nodes that don't match
> "^(ethernet-)?port@[0-8]$" are not rejected here. The inherited
> dsa.yaml#/$defs/ethernet-ports and ethernet-switch.yaml both accept any
> "^(ethernet-)?port@[0-9a-f]+$" node through dsa-port.yaml.
>
> So a node like ethernet-port@9 { reg = <9>; ... } or ethernet-port@a passes
> dt_binding_check and dtbs_check. It also skips the local RGMII delay
> constraints. The problem only shows up at probe time:
>
> net/dsa/dsa.c:dsa_switch_parse_ports_of() {
> ...
> if (reg >= ds->num_ports) {
> dev_err(ds->dev, "port %pOF index %u exceeds num_ports (%u)\n",
> port, reg, ds->num_ports);
> ...
> }
>
> Should the schema reject port nodes outside 0-8?
>
> > + type: object
> > + description: Ethernet switch ports
> > + additionalProperties: true
> > +
> > + allOf:
> > + - if:
> > + properties:
> > + phy-mode:
> > + contains:
> > + enum:
> > + - rgmii
> > + - rgmii-rxid
> > + - rgmii-txid
> > + - rgmii-id
> > + then:
> > + properties:
> > + rx-internal-delay-ps:
> > + $ref: "#/$defs/internal-delay-ps"
> > + tx-internal-delay-ps:
> > + $ref: "#/$defs/internal-delay-ps"
>
> [ ... ]
>
> > +$defs:
> > + internal-delay-ps:
> > + description:
> > + Disable the delay line using 0 ps, or enable the 2000 ps delay. The
> > + delay line is not tunable, so no other phase can be selected.
> > + enum: [0, 2000]
> > + default: 0
>
> [Severity: Medium]
> Is it intended that rx/tx-internal-delay-ps on the MAC side port nodes turns
> the full 2 ns RGMII delay on and off, for all four rgmii phy-modes?
>
> Documentation/devicetree/bindings/net/ethernet-controller.yaml says these
> MAC node properties "should be used to indicate fine tuning performed by the
> MAC. The values expected here are small. A value of 2000ps, i.e 2ns, and a
> phy-mode of 'rgmii' will not be accepted by Reviewers."
>
> The same document says that when the MAC adds the delay, 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."
>
> This schema accepts phy-mode = "rgmii-id" together with
> rx-internal-delay-ps = <2000>. In the driver later in this series,
> lan9645x_parse_mac_delay() in lan9645x_port.c only checks for 0 or 2000.
> lan9645x_rgmii_dll_config() in lan9645x_phylink.c then enables the delay line
> directly from the parsed value:
>
> drivers/net/dsa/microchip/lan9645x/lan9645x_phylink.c:lan9645x_rgmii_dll_config() {
> ...
> HSIO_DLL_CFG_DLL_ENA_SET(p->rx_internal_delay) |
> HSIO_DLL_CFG_DELAY_ENA_SET(p->rx_internal_delay),
> ...
> }
>
> Nothing there checks phy-mode or removes the delay from the interface that
> phylink passes to the PHY.
>
> Take port 7 or 8 with a phy-handle, phy-mode "rgmii-id" and
> rx-internal-delay-ps = <2000>. Wouldn't the MAC and the PHY each add 2 ns,
> leaving a DT that passes validation with a link that doesn't work?
>
> The example also uses phy-mode = "rgmii" on the CPU port. For any RGMII mode
> other than 'rgmii-id', ethernet-controller.yaml says it "is probably wrong"
> unless justified.
>
Dismissed. This follows the binding model introduced for sja1105 in
commit ac41ac81e331 ("dt-bindings: net: dsa: sja1105: add
{rx,tx}-internal-delay-ps") and used by microchip,lan937x.yaml since
commit 8926d94e5c50, which also restricts the values to 0 and 2000 ps.
The MAC delay lines are configured only from rx/tx-internal-delay-ps,
independently of phy-mode and of whether the port uses a PHY or a
fixed-link, and phy-mode is passed unmodified to the PHY. The hardware
has a fixed 2 ns delay line, 0 and 2000 are the only values it can
express. For the CPU port, phy-mode "rgmii" with a fixed-link matches
the sja1105 and lan937x examples.
> > +
> > +examples:
>
> [ ... ]
>
> > + ethernet-port@7 {
> > + reg = <7>;
> > + ethernet = <&cpu_host_port>;
> > + phy-mode = "rgmii";
>
> [ ... ]
>
> --
> Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260929-dsa_lan9645x_switch_driver_base-v13-0-827c2d3617f2%40microchip.com
next prev parent reply other threads:[~2026-10-07 14:34 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-29 7:48 [PATCH net-next v13 0/9] net: dsa: add DSA support for the LAN9645x switch chip family Jens Emil Schulz Østergaard
2026-09-29 7:48 ` [PATCH net-next v13 1/9] net: dsa: add tag driver for LAN9645X Jens Emil Schulz Østergaard
2026-10-02 21:14 ` netdev-bot+sashiko
2026-10-06 7:19 ` Jens Emil Schulz Ostergaard
2026-09-29 7:48 ` [PATCH net-next v13 2/9] dt-bindings: net: lan9645x: add LAN9645X switch bindings Jens Emil Schulz Østergaard
2026-10-02 21:14 ` netdev-bot+sashiko
2026-10-07 14:34 ` Jens Emil Schulz Ostergaard [this message]
2026-10-06 3:19 ` Rob Herring (Arm)
2026-09-29 7:48 ` [PATCH net-next v13 3/9] net: dsa: lan9645x: add autogenerated register macros Jens Emil Schulz Østergaard
2026-09-29 7:48 ` [PATCH net-next v13 4/9] net: dsa: lan9645x: add basic dsa driver for LAN9645X Jens Emil Schulz Østergaard
2026-10-02 21:14 ` netdev-bot+sashiko
2026-09-29 7:48 ` [PATCH net-next v13 5/9] net: dsa: lan9645x: add vlan support Jens Emil Schulz Østergaard
2026-10-02 21:14 ` netdev-bot+sashiko
2026-10-06 12:31 ` Jens Emil Schulz Ostergaard
2026-09-29 7:48 ` [PATCH net-next v13 6/9] net: dsa: lan9645x: add mac table integration Jens Emil Schulz Østergaard
2026-10-02 21:14 ` netdev-bot+sashiko
2026-10-06 12:34 ` Jens Emil Schulz Ostergaard
2026-09-29 7:48 ` [PATCH net-next v13 7/9] net: dsa: lan9645x: add mdb management Jens Emil Schulz Østergaard
2026-10-02 21:14 ` netdev-bot+sashiko
2026-10-06 12:51 ` Jens Emil Schulz Ostergaard
2026-09-29 7:48 ` [PATCH net-next v13 8/9] net: dsa: lan9645x: add bridge support Jens Emil Schulz Østergaard
2026-10-02 21:14 ` netdev-bot+sashiko
2026-10-07 14:23 ` Jens Emil Schulz Ostergaard
2026-09-29 7:48 ` [PATCH net-next v13 9/9] net: dsa: lan9645x: add port statistics Jens Emil Schulz Østergaard
2026-10-02 21:14 ` netdev-bot+sashiko
2026-10-07 14:29 ` Jens Emil Schulz Ostergaard
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=02cce6979c4902e75f2f9b94621f2f81e82b879a.camel@microchip.com \
--to=jensemil.schulzostergaard@microchip.com \
--cc=Steen.Hegelund@microchip.com \
--cc=UNGLinuxDriver@microchip.com \
--cc=andrew@lunn.ch \
--cc=conor+dt@kernel.org \
--cc=daniel.machon@microchip.com \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=edumazet@google.com \
--cc=geert+renesas@glider.be \
--cc=horms@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=magnus.damm@gmail.com \
--cc=netdev-bot+sashiko@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=pabeni@redhat.com \
--cc=robh@kernel.org \
--cc=woojung.huh@microchip.com \
/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®