From: netdev-bot+sashiko@kernel.org
To: joseph@telaak.dev
Cc: andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org,
kuba@kernel.org, pabeni@redhat.com, robh@kernel.org,
krzk+dt@kernel.org, conor+dt@kernel.org,
richardcochran@gmail.com, alexandre.torgue@foss.st.com,
joabreu@synopsys.com, maxime.chevallier@bootlin.com,
mcoquelin.stm32@gmail.com, gch981213@gmail.com,
linux@armlinux.org.uk, linux-mips@vger.kernel.org,
netdev@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH net-next v2 1/3] dt-bindings: net: ethernet-controller: Allow a device-specific nvmem cell
Date: Thu, 03 Dec 2026 22:01:13 +0000 [thread overview]
Message-ID: <179633527382.3146.12751374093521833744@kernel.org> (raw)
In-Reply-To: <20261201-sf19a2890-gmac-v2-1-8d2c513db496@telaak.dev>
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.
Low priority / nit picks for your consideration:
- [Low] Commit "dt-bindings: net: ethernet-controller: Allow a device-
specific nvmem cell" loosens the common schema in…
- [Low] The common schema in ethernet-controller.yaml (and the Siflower
binding added later in the series, which copies it) fixes `mac-…
- [Low] dt-bindings: net: nvmem-cells enumerates entries in free-form
description
--
dt-bindings: net: ethernet-controller: Allow a device-specific nvmem cell
This commit relaxes nvmem-cells and nvmem-cell-names in
ethernet-controller.yaml so that a second nvmem cell, specific to the
device, can follow the mac-address cell. The first user is the Siflower
SF19A2890 GMAC, which keeps per-unit RGMII delay calibration in nvmem.
> diff --git a/Documentation/devicetree/bindings/net/ethernet-controller.yaml b/Documentation/devicetree/bindings/net/ethernet-controller.yaml
> index 30b2a335116e9..da27ff8012eba 100644
> --- a/Documentation/devicetree/bindings/net/ethernet-controller.yaml
> +++ b/Documentation/devicetree/bindings/net/ethernet-controller.yaml
> @@ -22,12 +22,17 @@ properties:
> Specifies maximum speed in Mbit/s supported by the device.
>
> nvmem-cells:
> - maxItems: 1
> + minItems: 1
> + maxItems: 2
> description:
> - Reference to an nvmem node for the MAC address
> + Reference to an nvmem node for the MAC address, then optionally to a
> + cell that the device's own binding describes
>
> nvmem-cell-names:
> - const: mac-address
> + minItems: 1
> + items:
> + - const: mac-address
[Severity: Low]
The nvmem-cells description now lists both entries in prose. It also
restates that the second entry is optional, which minItems: 1 already
says.
nvmem-cell-names below becomes an items list with a fixed position for
each entry. Would it be clearer to describe nvmem-cells the same way,
with one description per entry? For example:
nvmem-cells:
minItems: 1
items:
- description: MAC address
- description: Cell named by the device's own binding
That keeps nvmem-cells and nvmem-cell-names in step. The text for each
entry also stays accurate when a device binding narrows the list, as
siflower,sf19a2890-gmac.yaml does later in this series.
Bindings normally use items with per-entry descriptions when each
entry has a fixed position. maxItems with a single free-form
description is meant for lists of interchangeable entries, and that
is not what this property is any more.
This has no runtime effect. It is only about how the schema documents
the property.
[Severity: Low]
With mac-address fixed at index 0, how can a node use the device-specific
cell when the MAC address is not stored in nvmem? Take a SF19A2890 board
that has only the calibration cell:
nvmem-cells = <&rgmii_delay>;
nvmem-cell-names = "rgmii-delay";
This would fail validation, because item 0 must be const: mac-address. The
MAC could still come from mac-address or local-mac-address set by the
bootloader.
At runtime both cells are optional and looked up by name. This is in
drivers/net/ethernet/stmicro/stmmac/dwmac-sf19a2890.c, added later in this
series:
cell = devm_nvmem_cell_get(dev, "rgmii-delay");
if (IS_ERR(cell)) {
if (PTR_ERR(cell) == -ENOENT)
return 0;
and this is in of_get_mac_address_nvmem() in net/core/of_net.c:
cell = of_nvmem_cell_get(np, "mac-address");
So only the schema needs the fixed position. To pass dtbs_check, a board
would have to add a mac-address nvmem cell it doesn't otherwise use. That
cell would not override a MAC set by the bootloader, because
of_get_mac_address() checks the DT properties before it falls back to
nvmem.
siflower,sf19a2890-gmac.yaml, added later in the series, uses the same
order. The commit message says "Allow a second cell after mac-address", so
the order seems deliberate, but it doesn't handle this case.
Would an items: enum: list, as used in qcom,ath10k.yaml, work better here?
> + - description: Named by the device's own binding
[Severity: Low]
This entry has only a description, with no const, enum or pattern, and
nvmem-cells now allows maxItems: 2. Does that mean any binding that
references ethernet-controller.yaml without narrowing these properties now
accepts any second nvmem cell?
For example, fsl,fec.yaml passes both properties through unchanged:
nvmem-cells: true
nvmem-cell-names: true
nxp,dwmac-imx.yaml, microchip,lan95xx.yaml and marvell,prestera.yaml do the
same. The switch port bindings also inherit this through
ethernet-switch-port.yaml.
On those nodes, this now passes dt_binding_check and dtbs_check:
nvmem-cells = <&a>, <&b>;
nvmem-cell-names = "mac-address", "anything";
Before this patch, const: mac-address rejected it. The drivers for these
nodes never read a second cell. The generic consumer,
of_get_mac_address_nvmem(), only looks up "mac-address" by name.
Later in the series, siflower,sf19a2890-gmac.yaml pins this entry to
const: rgmii-delay, so the Siflower binding is constrained. Every other
binding that uses the common schema has no constraint on the second name.
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261201-sf19a2890-gmac-v2-0-8d2c513db496%40telaak.dev
next prev parent reply other threads:[~2026-12-03 22:01 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-01 7:00 [PATCH net-next v2 0/3] net: stmmac: Add the Siflower SF19A2890 glue Joseph Telaak via B4 Relay
2026-12-01 7:00 ` [PATCH net-next v2 1/3] dt-bindings: net: ethernet-controller: Allow a device-specific nvmem cell Joseph Telaak via B4 Relay
2026-12-03 22:01 ` netdev-bot+sashiko [this message]
2026-12-01 7:00 ` [PATCH net-next v2 2/3] dt-bindings: net: Add Siflower SF19A2890 GMAC Joseph Telaak via B4 Relay
2026-12-03 22:01 ` netdev-bot+sashiko
2026-12-01 7:00 ` [PATCH net-next v2 3/3] net: stmmac: Add Siflower SF19A2890 glue Joseph Telaak via B4 Relay
2026-12-03 22:01 ` netdev-bot+sashiko
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=179633527382.3146.12751374093521833744@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=alexandre.torgue@foss.st.com \
--cc=andrew+netdev@lunn.ch \
--cc=conor+dt@kernel.org \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=edumazet@kernel.org \
--cc=gch981213@gmail.com \
--cc=joabreu@synopsys.com \
--cc=joseph@telaak.dev \
--cc=krzk+dt@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=maxime.chevallier@bootlin.com \
--cc=mcoquelin.stm32@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=richardcochran@gmail.com \
--cc=robh@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox