Netdev List
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: kory.maincent@bootlin.com
Cc: o.rempel@pengutronix.de, 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, roman@damex.org,
	maxime.chevallier@bootlin.com, thomas.petazzoni@bootlin.com,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	Phil.Edworthy@addsecure.com, devicetree@vger.kernel.org
Subject: Re: [PATCH net-next 8/8] net: pse-pd: tps23881: Add support for Vdd and Vpwr power supply
Date: Thu, 03 Dec 2026 14:21:43 +0000	[thread overview]
Message-ID: <179630770354.3146.335449007968453480@kernel.org> (raw)
In-Reply-To: <20261202-feat_tps23861-v1-8-7d8320369817@bootlin.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 drivers/net/pse-pd/tps23881.c, tps23881_i2c_probe() now
  calls devm_regulator_bulk_get_enable(dev, 2, {"vdd", "vpwr"}) on the…
- [Medium] tps23881_i2c_probe() now powers the TPS2388x itself with
  devm_regulator_bulk_get_enable() (line 1443), but the only wait after…
- [Low] In tps23881_i2c_probe() the devm-managed regulator enable (line
  1443) is registered before the reset GPIO (devm_gpiod_get_optional at…

--

net: pse-pd: tps23881: Add support for Vdd and Vpwr power supply

This commit adds handling for the Vdd and Vpwr supplies to the TPS23881
PSE controller driver. tps23881_i2c_probe() now gets and enables both
supplies with devm_regulator_bulk_get_enable() before the reset GPIO is
requested.

> diff --git a/drivers/net/pse-pd/tps23881.c b/drivers/net/pse-pd/tps23881.c
> index 5736f052732a2..759b3039ce21c 100644
> --- a/drivers/net/pse-pd/tps23881.c
> +++ b/drivers/net/pse-pd/tps23881.c
> @@ -1419,6 +1419,7 @@ static int tps23881_setup_irq(struct tps23881_priv *priv, int irq)
>  
>  static int tps23881_i2c_probe(struct i2c_client *client)
>  {
> +	static const char * const regulators[] = { "vdd", "vpwr" };
>  	struct device *dev = &client->dev;
>  	const struct tps23881_info *info;
>  	struct tps23881_priv *priv;
> @@ -1439,6 +1440,12 @@ static int tps23881_i2c_probe(struct i2c_client *client)
>  	if (!priv)
>  		return -ENOMEM;
>  
> +	ret = devm_regulator_bulk_get_enable(dev, ARRAY_SIZE(regulators),
> +					     regulators);
> +	if (ret)
> +		return dev_err_probe(dev, ret,
> +				     "Failed to enable regulators\n");
> +

[Severity: Medium]
On device trees with no controller-level vpwr-supply, which regulator does
the "vpwr" consumer end up with?

If the property is missing on the controller node, of_get_regulator() in
drivers/regulator/of_regulator.c falls back to a recursive search of the
child nodes:

	regnode = of_parse_phandle(node, prop_name, 0);
	if (regnode)
		return regnode;

	regnode = of_get_child_regulator(dev->of_node, prop_name);

Before the earlier binding patch in this series, the binding only allowed
vpwr-supply in the pse-pi nodes. The example in ti,tps23881.yaml still has
it only there.

On those DTs, the controller's "vpwr" consumer would silently resolve to
the first PI's supply (vpwr1 in the binding example, found via channels ->
pse-pis -> pse-pi@0). No dummy regulator message would be printed.

That supply then stays enabled for the whole lifetime of the device. Can
the first PI rail still be turned off when the PIs on it are disabled?
The other PI rails (vpwr2) are not held, so the PIs would be treated
differently.

The commit message only says Vdd and Vpwr are enabled at probe time. Is
this binding to a PI supply intended for existing DTs?

[Severity: Medium]
Now that probe can power up the chip itself, is there still a power-on
delay when no reset GPIO is present? The only wait after power-on is
inside the reset block later in tps23881_i2c_probe():

	if (reset) {
		...
		msleep(50);
	}

	ret = i2c_smbus_read_byte_data(client, TPS23881_REG_DEVID);

reset-gpios is optional in the binding. Without it, if vdd/vpwr were off
before probe, the DEVID read and tps23881_flash_sram_fw() run straight
after the regulators are enabled.

The regulator core only waits for the regulator's own enable/ramp time. It
does not wait for the chip's power-on reset.

The comment in the reset block cites a 20ms minimum after power-on reset
and a 50ms delay before SRAM loading. Without that wait, could the DEVID
read fail or return a bad ID (probe fails with "Wrong device ID")? Could
the SRAM and parity firmware be written while the chip is still in POR,
leaving it on ROM firmware or in safe mode (FWREV 0xFF)?

>  	reset = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_HIGH);

[Severity: Low]
What state is the RESET pin in when the supplies are turned off during
teardown?

The regulators are registered with devm before the reset GPIO, so devm
frees them in the reverse order. This happens on unbind and on a probe
failure after this point, for example in tps23881_flash_sram_fw(),
devm_pse_controller_register() or tps23881_setup_irq().

The GPIO descriptor is freed first, and the line stays deasserted. Then
vdd/vpwr are disabled. Nothing asserts reset before power is removed.

If the RESET pin is not fail-safe, could the host drive the unpowered
chip through that pin and back-power it? Before this patch the driver
never removed power, so this state could not happen.

>  	if (IS_ERR(reset))
>  		return dev_err_probe(&client->dev, PTR_ERR(reset), "Failed to get reset GPIO\n");

[ ... ]

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261202-feat_tps23861-v1-0-7d8320369817%40bootlin.com

      reply	other threads:[~2026-12-03 14:21 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-02 14:08 [PATCH net-next 0/8] net: pse-pd: Preparation series for supporting the TPS23861 controller Kory Maincent
2026-12-02 14:08 ` [PATCH net-next 1/8] dt-bindings: pse-pd: ti,tps23881: Add VDD and VPWR regulator supply Kory Maincent
2026-12-03 14:21   ` netdev-bot+sashiko
2026-12-02 14:08 ` [PATCH net-next 2/8] net: pse-pd: Add helpers to convert between mW and uA Kory Maincent (AddSecure)
2026-12-02 14:08 ` [PATCH net-next 3/8] net: pse-pd: si3474: Use new mW/uA conversion helpers Kory Maincent (AddSecure)
2026-12-02 14:08 ` [PATCH net-next 4/8] net: pse-pd: tps23881: " Kory Maincent (AddSecure)
2026-12-02 14:08 ` [PATCH net-next 5/8] net: pse-pd: tps23881: Clean up register defines and comments Kory Maincent (AddSecure)
2026-12-02 14:08 ` [PATCH net-next 6/8] net: pse-pd: tps23881: Factor out power policy configuration Kory Maincent (AddSecure)
2026-12-02 14:08 ` [PATCH net-next 7/8] net: pse-pd: tps23881: Use fsleep instead of mdelay Kory Maincent (AddSecure)
2026-12-02 14:08 ` [PATCH net-next 8/8] net: pse-pd: tps23881: Add support for Vdd and Vpwr power supply Kory Maincent (AddSecure)
2026-12-03 14:21   ` netdev-bot+sashiko [this message]

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=179630770354.3146.335449007968453480@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=Phil.Edworthy@addsecure.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=kory.maincent@bootlin.com \
    --cc=krzk+dt@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maxime.chevallier@bootlin.com \
    --cc=netdev@vger.kernel.org \
    --cc=o.rempel@pengutronix.de \
    --cc=pabeni@redhat.com \
    --cc=robh@kernel.org \
    --cc=roman@damex.org \
    --cc=thomas.petazzoni@bootlin.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