Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Jacky Chou" <jacky_chou@aspeedtech.com>
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH net-next v5 3/7] net: ftgmac100: Add AST2700 compatible support
Date: Thu, 05 Nov 2026 05:14:45 +0000	[thread overview]
Message-ID: <sashiko-outbox-198580@kernel.org> (raw)
In-Reply-To: <20261104-support_ast2700-v5-3-44057f4dde75@aspeedtech.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] net: ftgmac100: missing reset deassertion for AST2700 in ftgmac100_probe()
--

commit 1b009bb5f71bd76cdeadd675e668f4c589bb3d51
Author: Jacky Chou <jacky_chou@aspeedtech.com>

net: ftgmac100: Add AST2700 compatible support

This commit adds match data and the OF compatible entry for the Aspeed
AST2700 FTGMAC100 Ethernet controller.

> diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/ethernet/faraday/ftgmac100.c
> index 6d2fe5c2f3903..67b1fa464a421 100644
> --- a/drivers/net/ethernet/faraday/ftgmac100.c
> +++ b/drivers/net/ethernet/faraday/ftgmac100.c

[ ... ]

> @@ -2017,7 +2018,8 @@ static int ftgmac100_probe(struct platform_device *pdev)
>  
>  	if (priv->mac_id == FTGMAC100_AST2400 ||
>  	    priv->mac_id == FTGMAC100_AST2500 ||
> -	    priv->mac_id == FTGMAC100_AST2600) {
> +	    priv->mac_id == FTGMAC100_AST2600 ||
> +	    priv->mac_id == FTGMAC100_AST2700) {
>  		priv->rxdes0_edorr_mask = BIT(30);
>  		priv->txdes0_edotr_mask = BIT(30);
>  		priv->is_aspeed = true;

[Severity: High]
Does AST2700 need its reset control deasserted and clocks enabled during
ftgmac100_probe() before accessing registers or bringing up the interface?

On AST2400, AST2500, and AST2600, the MAC clock gates in clk-aspeed.c and
clk-ast2600.c include a coupled reset index, so enabling the clock in
ftgmac100_setup_clk() automatically deasserts the SCU MAC reset.

On AST2700, however, the MAC clock gates in drivers/clk/aspeed/clk-ast2700.c
only control SCU1_CLK_STOP via ast2700_clk_enable() and do not deassert
SCU1_RESET_MAC0..2:

drivers/clk/aspeed/clk-ast2700.c:
	GATE_CLK(SCU1_CLK_GATE_MAC0CLK, CLK_GATE_ASPEED, "mac0clk-gate", -1,
		 SCU1_CLK_STOP, 8, 0),
	GATE_CLK(SCU1_CLK_GATE_MAC1CLK, CLK_GATE_ASPEED, "mac1clk-gate", -1,
		 SCU1_CLK_STOP, 9, 0),
	GATE_CLK(SCU1_CLK_GATE_MAC2CLK, CLK_GATE_ASPEED, "mac2clk-gate", -1,
		 SCU1_CLK_STOP, 10, 0),

In ftgmac100_probe(), priv->rst is acquired via
devm_reset_control_get_optional_exclusive(), but reset_control_deassert()
is never called during probe:

drivers/net/ethernet/faraday/ftgmac100.c:ftgmac100_probe() {
	...
	/* MAC address from chip or random one */
	err = ftgmac100_initial_mac(priv);
	...
	priv->rst = devm_reset_control_get_optional_exclusive(priv->dev, NULL);
	if (IS_ERR(priv->rst)) {
		err = PTR_ERR(priv->rst);
		goto err;
	}

	if (priv->is_aspeed) {
		err = ftgmac100_setup_clk(priv);
		if (err)
			goto err;
	}
	...
}

Furthermore, ftgmac100_reset_and_config_mac() only asserts and deasserts
priv->rst when phydev->interface is PHY_INTERFACE_MODE_RMII:

drivers/net/ethernet/faraday/ftgmac100.c:ftgmac100_reset_and_config_mac() {
	...
	if (priv->is_aspeed && priv->netdev->phydev->interface == PHY_INTERFACE_MODE_RMII) {
		int err;

		err = reset_control_assert(priv->rst);
		...
		err = reset_control_deassert(priv->rst);
		...
	}
	...
}

If the bootloader leaves the MAC in reset, or when operating in RGMII mode,
won't ftgmac100_initial_mac() read FTGMAC100_OFFSET_MAC_MADR and
FTGMAC100_OFFSET_MAC_LADR while the clock is still gated and reset is
asserted, and won't ftgmac100_open() -> ftgmac100_reset_and_config_mac() ->
ftgmac100_reset_mac() fail with -EIO because priv->rst was never deasserted?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261104-support_ast2700-v5-0-44057f4dde75@aspeedtech.com?part=3

  reply	other threads:[~2026-11-05  5:14 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-04  5:13 [PATCH net-next v5 0/7] net: ftgmac100: Add AST2700 support Jacky Chou
2026-11-04  5:13 ` [PATCH net-next v5 1/7] dt-bindings: net: ftgmac100: Make Aspeed compatibles standalone Jacky Chou
2026-11-04 10:37   ` Krzysztof Kozlowski
2026-11-04 11:21     ` 回覆: " Jacky Chou
2026-11-05 11:59       ` Krzysztof Kozlowski
2026-11-05 12:49         ` 回覆: " Jacky Chou
2026-11-05  5:14   ` sashiko-bot
2026-11-04  5:13 ` [PATCH net-next v5 2/7] dt-bindings: net: ftgmac100: Add AST2700 compatible Jacky Chou
2026-11-04 10:41   ` Krzysztof Kozlowski
2026-11-05 12:52     ` 回覆: " Jacky Chou
2026-11-05  5:14   ` sashiko-bot
2026-11-04  5:13 ` [PATCH net-next v5 3/7] net: ftgmac100: Add AST2700 compatible support Jacky Chou
2026-11-05  5:14   ` sashiko-bot [this message]
2026-11-04  5:13 ` [PATCH net-next v5 4/7] net: ftgmac100: Enable AST2700 RMII support Jacky Chou
2026-11-04  5:13 ` [PATCH net-next v5 5/7] net: ftgmac100: Require phy-mode for AST2700 Jacky Chou
2026-11-05  5:14   ` sashiko-bot
2026-11-04  5:13 ` [PATCH net-next v5 6/7] net: ftgmac100: Add AST2700 upper DMA address support Jacky Chou
2026-11-04  5:14 ` [PATCH net-next v5 7/7] net: ftgmac100: Allow building on ARM64 Jacky Chou

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=sashiko-outbox-198580@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=jacky_chou@aspeedtech.com \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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