Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Kory Maincent (AddSecure)" <kory.maincent@bootlin.com>
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH net-next 6/8] net: pse-pd: tps23881: Factor out power policy configuration
Date: Thu, 03 Dec 2026 14:11:08 +0000	[thread overview]
Message-ID: <sashiko-outbox-247929@kernel.org> (raw)
In-Reply-To: <20261202-feat_tps23861-v1-6-7d8320369817@bootlin.com>

Thank you for your contribution! Sashiko AI review found no new issues
in this patch, but noticed 1 related pre-existing issue it does not
introduce:
- [High] net: pse-pd: tps23881: 16-bit foldback value truncated in
  tps23881_pi_enable_manual_pol() [1]
--

commit a24d988872c37423e41bab88b1a60b38aaeef9aa
Author: Kory Maincent (AddSecure) <kory.maincent@bootlin.com>

net: pse-pd: tps23881: Factor out power policy configuration

This commit factors out the sequence that enables manual power policy and
configures the power policy limit into a new tps23881_pi_conf_pw_pol_limit()
helper.

> diff --git a/drivers/net/pse-pd/tps23881.c b/drivers/net/pse-pd/tps23881.c
> index 04ee7f8f3e18a..a7ff69e2561b4 100644
> --- a/drivers/net/pse-pd/tps23881.c
> +++ b/drivers/net/pse-pd/tps23881.c
> @@ -215,6 +215,23 @@ static int tps23881_pi_enable(struct pse_controller_dev *pcdev, int id)
>  	return 0;
>  }
>  
> +static int tps23881_pi_conf_pw_pol_limit(struct tps23881_priv *priv, int id)
> +{
> +	int ret;
> +
> +	/* No power policy */
> +	if (priv->port[id].pw_pol < 0)
> +		return 0;
> +
> +	ret = tps23881_pi_enable_manual_pol(priv, id);

[Severity: High]
This problem wasn't introduced by this patch, but does
tps23881_pi_enable_manual_pol() truncate the 16-bit TPS23881_REG_FOLDBACK
value [1] on channels 4 through 7?

drivers/net/pse-pd/tps23881.c:tps23881_pi_enable_manual_pol() {
	ret = i2c_smbus_read_byte_data(client, TPS23881_REG_FOLDBACK);
	if (ret < 0)
		return ret;
    ...
	chan = priv->port[id].chan[0];
	val = tps23881_set_val(ret, chan, 0, BIT(chan % 4), BIT(chan % 4));
	return i2c_smbus_write_byte_data(client, TPS23881_REG_FOLDBACK, val);
}

The driver enables 16-bit register access (TPS23881_REG_NBITACC), so
tps23881_set_val() shifts the bit for channels 4 through 7 into bits 8..15
of val.  Using i2c_smbus_read_byte_data() and i2c_smbus_write_byte_data()
instead of the word accessors drops the upper byte, leaving the manual
power policy disabled on ports mapped to channels 4 through 7.

[1] https://sashiko.dev/#/bug/linux-200958a2-c64a-48bf-b1f6-1584a6f2b35d

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261202-feat_tps23861-v1-0-7d8320369817@bootlin.com?part=6

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

Thread overview: 12+ 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-03 14:11   ` sashiko-bot [this message]
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

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-247929@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=kory.maincent@bootlin.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