From: netdev-bot+sashiko@kernel.org
To: wanghr2026@mail.zgclab.edu.cn
Cc: chester.a.unal@arinc9.com, daniel@makrotopia.org, andrew@lunn.ch,
olteanv@gmail.com, davem@davemloft.net, edumazet@kernel.org,
kuba@kernel.org, pabeni@redhat.com, matthias.bgg@gmail.com,
angelogioacchino.delregno@collabora.com, netdev@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net 3/5] net: dsa: mt7530: register the GPIO controller last in setup
Date: Wed, 25 Nov 2026 09:27:12 +0000 [thread overview]
Message-ID: <179559883260.3135.17892460412824046133@kernel.org> (raw)
In-Reply-To: <179550875790.4156.7464757884919680732@mail.zgclab.edu.cn>
Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 1 · Low: 0
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] net: dsa: mt7530: mt7530_setup_gpio() still runs before
fallible setup steps
--
> diff --git a/drivers/net/dsa/mt7530.c b/drivers/net/dsa/mt7530.c
> --- a/drivers/net/dsa/mt7530.c
> +++ b/drivers/net/dsa/mt7530.c
> @@ -2585,6 +2585,11 @@ mt7530_setup(struct dsa_switch *ds)
> }
> }
>
> + /* Flush the FDB table */
> + ret = mt7530_fdb_cmd(priv, MT7530_FDB_FLUSH, NULL);
> + if (ret < 0)
> + return ret;
> +
> #ifdef CONFIG_GPIOLIB
> if (of_property_read_bool(priv->dev->of_node, "gpio-controller")) {
> ret = mt7530_setup_gpio(priv);
[Severity: Medium]
The commit message says this makes the GPIO controller visible only
once every fallible step of setup has succeeded. However, mt7530_setup()
is only the priv->info->sw_setup() callback. After it returns 0,
mt753x_setup() still calls mt7530_setup_irq() and mt7530_setup_mdio().
Both of those can fail, and mt7530_setup_irq() can also return
-EPROBE_DEFER.
If either of them fails, the gpio_chip that mt7530_setup_gpio()
registered with devm_gpiochip_add_data() on priv->dev stays published.
Once the next patch disables core_pwr and io_pwr on the failure path,
consumers would be left poking MT7530_LED_GPIO_* registers on an
unpowered switch. That is the situation this patch says it prevents.
The same applies to teardown. The chip is tied to devres on priv->dev,
not to the DSA setup/teardown cycle. Consider a multi-switch tree where
a sibling switch fails or defers. mt753x_teardown() then disables the
regulators without unbinding priv->dev, so the chip remains registered.
The next dsa_tree_setup() attempt would run mt7530_setup_gpio() again
and add a second controller.
Should the GPIO registration move to the end of mt753x_setup(), after
mt7530_setup_mdio(), with an explicit gpiochip_remove() in the error
path and in mt753x_teardown()? Or would you rather register it from
probe instead? Either way, the commit message should not claim it is
the last fallible step as things stand.
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/179550875789.4156.361477684651496992%40mail.zgclab.edu.cn
next prev parent reply other threads:[~2026-11-25 9:27 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-24 8:25 [PATCH net 0/5] net: dsa: mt7530: fix regulator disable on teardown and error paths Haoran Wang
2026-11-24 8:25 ` [PATCH net 3/5] net: dsa: mt7530: register the GPIO controller last in setup Haoran Wang
2026-11-24 18:38 ` Andrew Lunn
2026-11-25 9:27 ` netdev-bot+sashiko [this message]
2026-11-24 8:25 ` [PATCH net 4/5] net: dsa: mt7530: disable regulators on setup failure Haoran Wang
2026-11-24 18:42 ` Andrew Lunn
2026-11-24 8:25 ` [PATCH net 5/5] net: dsa: mt7530: disable regulators on mt753x_setup() failure Haoran Wang
2026-11-24 18:50 ` Andrew Lunn
2026-11-25 9:27 ` netdev-bot+sashiko
2026-11-24 8:25 ` [PATCH net 1/5] net: dsa: mt7530: disable regulators on switch teardown Haoran Wang
2026-11-24 18:31 ` Andrew Lunn
2026-11-25 9:27 ` netdev-bot+sashiko
2026-11-24 8:25 ` [PATCH net 2/5] net: dsa: mt7530: factor out mt7530_disable_pwrs() Haoran Wang
2026-11-24 18:35 ` Andrew Lunn
2026-11-24 8:33 ` [PATCH net 0/5] net: dsa: mt7530: fix regulator disable on teardown and error paths netdev-bot+sinfo
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=179559883260.3135.17892460412824046133@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=andrew@lunn.ch \
--cc=angelogioacchino.delregno@collabora.com \
--cc=chester.a.unal@arinc9.com \
--cc=daniel@makrotopia.org \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=matthias.bgg@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=pabeni@redhat.com \
--cc=wanghr2026@mail.zgclab.edu.cn \
/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