Devicetree
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: jacky_chou@aspeedtech.com
Cc: andrew+netdev@lunn.ch, davem@davemloft.net, kuba@kernel.org,
	pabeni@redhat.com, robh@kernel.org, krzk+dt@kernel.org,
	conor+dt@kernel.org, ratbert@faraday-tech.com,
	edumazet@kernel.org, hkallweit1@gmail.com, linux@armlinux.org.uk,
	netdev@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, andrew@lunn.ch
Subject: Re: [PATCH net-next v6 2/7] dt-bindings: net: ftgmac100: Add AST2700 compatible
Date: Mon, 16 Nov 2026 13:54:15 +0000	[thread overview]
Message-ID: <179483725554.3136.8359940788845125105@kernel.org> (raw)
In-Reply-To: <20261112-support_ast2700-v6-2-238020bf46cf@aspeedtech.com>

Thank you for your contribution! Sashiko AI review found 3 potential
issue(s) to consider.

Critical: 0 · High: 0 · Medium: 2 · Low: 1

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] In
  Documentation/devicetree/bindings/net/faraday,ftgmac100.yaml,…
- [Medium] dt-bindings: net: ftgmac100: requiring phy-mode on AST2700
  breaks use-ncsi
- [Low] This commit adds a new allOf block (faraday,ftgmac100.yaml lines
  90-97) that makes `phy-mode` mandatory for `aspeed,ast2700-mac`.

--

dt-bindings: net: ftgmac100: Add AST2700 compatible

This commit adds aspeed,ast2700-mac to the FTGMAC100 binding as a
standalone compatible. It extends the resets and clocks conditionals to
cover AST2700, and it makes phy-mode a required property for AST2700.

> diff --git a/Documentation/devicetree/bindings/net/faraday,ftgmac100.yaml b/Documentation/devicetree/bindings/net/faraday,ftgmac100.yaml
> index 9d352e3686aaf..613d4f1caa4fa 100644
> --- a/Documentation/devicetree/bindings/net/faraday,ftgmac100.yaml
> +++ b/Documentation/devicetree/bindings/net/faraday,ftgmac100.yaml
> @@ -16,6 +16,7 @@ properties:
>        - aspeed,ast2400-mac
>        - aspeed,ast2500-mac
>        - aspeed,ast2600-mac
> +      - aspeed,ast2700-mac
>  
>    reg:
>      maxItems: 1

[Severity: Medium]
An earlier patch in this series ("dt-bindings: net: ftgmac100: Make Aspeed
compatibles standalone") turned properties:compatible into a flat enum.
That enum accepts only a single string:

  compatible:
    enum:
      - faraday,ftgmac100
      - aspeed,ast2400-mac
      - aspeed,ast2500-mac
      - aspeed,ast2600-mac
      - aspeed,ast2700-mac

dt-schema expands this into a list that holds one item. A compatible with
two entries then fails with "is too long".

Do the in-tree Aspeed MAC nodes still validate? At the end of the series
they all still use the two-string form:

arch/arm/boot/dts/aspeed/aspeed-g4.dtsi:
    compatible = "aspeed,ast2400-mac", "faraday,ftgmac100";

arch/arm/boot/dts/aspeed/aspeed-g5.dtsi:
    compatible = "aspeed,ast2500-mac", "faraday,ftgmac100";

arch/arm/boot/dts/aspeed/aspeed-g6.dtsi:
    compatible = "aspeed,ast2600-mac", "faraday,ftgmac100";

No patch in the series updates these nodes. If that is right, dtbs_check
fails for every AST2400/AST2500/AST2600 board.

The binding also seems to contradict itself. This patch extends the
if/contains blocks for resets, phy-mode and clocks. Those blocks are
written for compatible lists with more than one entry, but the top-level
enum never lets such a list validate.

Could the binding use a oneOf that accepts both the standalone form and
the legacy pair of aspeed,*-mac plus faraday,ftgmac100? The other option
is to convert the in-tree DTS files in the same series.

[ ... ]

> @@ -79,12 +80,21 @@ allOf:
>            contains:
>              enum:
>                - aspeed,ast2600-mac
> +              - aspeed,ast2700-mac
>      then:
>        properties:
>          resets: true
>      else:
>        properties:
>          resets: false
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            const: aspeed,ast2700-mac
> +    then:
> +      required:
> +        - phy-mode

[Severity: Medium]
Is phy-mode really mandatory for every AST2700 MAC node? The binding
also documents the use-ncsi boolean. That mode runs the NC-SI stack
over RMII instead of talking to an MDIO PHY. The first example in this
file sets use-ncsi and has no phy-mode property, and that is a valid
setup on the earlier Aspeed parts.

With this rule, an aspeed,ast2700-mac node that uses use-ncsi fails
dtbs_check unless it also carries a redundant phy-mode.

The driver does not seem to need phy-mode in that case either.
ftgmac100_probe_dt() checks use-ncsi first and calls
ftgmac100_probe_ncsi(). That path registers a fixed PHY and connects
it with PHY_INTERFACE_MODE_RMII without ever reading phy-mode.

The commit message says the rule matches the driver's probe-time
requirement. However, the check added later in this series ("net:
ftgmac100: Require phy-mode for AST2700") sits in ftgmac100_mii_probe().
That function only runs for the legacy MDIO bus scan, which happens
only when there is no use-ncsi, fixed-link, phy-handle or mdio child
node. On AST2600 and AST2700 that path returns -ENODEV anyway, because
ftgmac100_setup_mdio() is only called for Faraday, AST2400 and
AST2500.

A binding should also describe hardware constraints rather than what
one version of the Linux driver checks at probe time.

Should the requirement be dropped? Or should it apply only to nodes
without use-ncsi, for example by adding a not/required use-ncsi
condition to the if clause?

[Severity: Low]
Can every AST2700 MAC instance meet this new requirement? The local
phy-mode enum allows only RGMII and RMII modes:

  phy-mode:
    enum:
      - rgmii
      - rgmii-id
      - rgmii-rxid
      - rgmii-txid
      - rmii

AST2700 SoC1 appears to have three MACs. There are three resets
(SCU1_RESET_MAC0/1/2) and three gate clocks (SCU1_CLK_GATE_MAC0CLK,
MAC1CLK and MAC2CLK).

However, there are only two RMII reference clocks (SCU1_CLK_MAC0RCLK and
SCU1_CLK_MAC1RCLK). The only RGMII/RMII pin groups are RGMII0, RGMII1,
RMII0 and RMII1. There is also an SGMII group in
arch/arm64/boot/dts/aspeed/aspeed-g7-soc1-pinctrl.dtsi:

	pinctrl_sgmii_default: sgmii-default-state {
		function = "SGMII";
		groups = "SGMII";

This suggests the third MAC supports only SGMII. That is an inference
from the pinctrl, clock and reset headers, not from a datasheet.

If so, a node for that MAC fails validation either way. Without phy-mode
it breaks the new required rule, and phy-mode = "sgmii" is rejected by
the enum.

Should sgmii be allowed for aspeed,ast2700-mac, so the binding describes
every instance of the hardware even before the driver supports SGMII?

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261112-support_ast2700-v6-0-238020bf46cf%40aspeedtech.com

  parent reply	other threads:[~2026-11-16 13:54 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-12  8:39 [PATCH net-next v6 0/7] net: ftgmac100: Add AST2700 support Jacky Chou
2026-11-12  8:39 ` [PATCH net-next v6 1/7] dt-bindings: net: ftgmac100: Make Aspeed compatibles standalone Jacky Chou
2026-11-12 18:43   ` Conor Dooley
2026-11-13  8:39   ` sashiko-bot
2026-11-16 13:54   ` netdev-bot+sashiko
2026-11-12  8:39 ` [PATCH net-next v6 2/7] dt-bindings: net: ftgmac100: Add AST2700 compatible Jacky Chou
2026-11-12 18:44   ` Conor Dooley
2026-11-13  8:39   ` sashiko-bot
2026-11-16 13:54   ` netdev-bot+sashiko [this message]
2026-11-16 14:10     ` Andrew Lunn
2026-11-12  8:39 ` [PATCH net-next v6 3/7] net: ftgmac100: Add AST2700 compatible support Jacky Chou
2026-11-13  8:39   ` sashiko-bot
2026-11-16 13:54   ` netdev-bot+sashiko
2026-11-12  8:39 ` [PATCH net-next v6 4/7] net: ftgmac100: Enable AST2700 RMII support Jacky Chou
2026-11-16 13:54   ` netdev-bot+sashiko
2026-11-12  8:39 ` [PATCH net-next v6 5/7] net: ftgmac100: Require phy-mode for AST2700 Jacky Chou
2026-11-13  8:39   ` sashiko-bot
2026-11-16 13:54   ` netdev-bot+sashiko
2026-11-12  8:39 ` [PATCH net-next v6 6/7] net: ftgmac100: Add AST2700 upper DMA address support Jacky Chou
2026-11-16 13:54   ` netdev-bot+sashiko
2026-11-12  8:39 ` [PATCH net-next v6 7/7] net: ftgmac100: Allow building on ARM64 Jacky Chou
2026-11-16 13:54   ` 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=179483725554.3136.8359940788845125105@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=andrew@lunn.ch \
    --cc=conor+dt@kernel.org \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=edumazet@kernel.org \
    --cc=hkallweit1@gmail.com \
    --cc=jacky_chou@aspeedtech.com \
    --cc=krzk+dt@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=ratbert@faraday-tech.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