Netdev List
 help / color / mirror / Atom feed
From: Kory Maincent <kory.maincent@bootlin.com>
To: Paolo Abeni <pabeni@redhat.com>,
	Kory Maincent <kory.maincent@bootlin.com>,
	Oleksij Rempel <o.rempel@pengutronix.de>,
	Jakub Kicinski <kuba@kernel.org>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Phil.Edworthy@addsecure.com, Sashiko <sashiko-bot@kernel.org>,
	thomas.petazzoni@bootlin.com, Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>
Subject: [PATCH net] net: pse-pd: tps23881: Fix FOLDBACK register access width
Date: Thu,  3 Dec 2026 15:44:51 +0100	[thread overview]
Message-ID: <20261203144455.473477-1-kory.maincent@bootlin.com> (raw)

From: "Kory Maincent (AddSecure)" <kory.maincent@bootlin.com>

The register map is configured for 16-bit accesses, but the FOLDBACK
register was read and written with 8-bit accesses. All other registers
use 16-bit accesses, except for the accesses done during firmware
loading and boot configuration.

Fix the FOLDBACK register access to use 16-bit reads and writes as
well.

Without this fix, setting power limit on ports 4 to 7 may not work
properly.

Signed-off-by: Kory Maincent (AddSecure) <kory.maincent@bootlin.com>
Fixes: 7f076ce3f1733 ("net: pse-pd: tps23881: Add support for power limit and measurement features")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://sashiko.dev/#/bug/linux-200958a2-c64a-48bf-b1f6-1584a6f2b35d
---
 drivers/net/pse-pd/tps23881.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/pse-pd/tps23881.c b/drivers/net/pse-pd/tps23881.c
index 4b1eec0fb045e..0354457c35eec 100644
--- a/drivers/net/pse-pd/tps23881.c
+++ b/drivers/net/pse-pd/tps23881.c
@@ -173,7 +173,7 @@ static int tps23881_pi_enable_manual_pol(struct tps23881_priv *priv, int id)
 	u8 chan;
 	u16 val;
 
-	ret = i2c_smbus_read_byte_data(client, TPS23881_REG_FOLDBACK);
+	ret = i2c_smbus_read_word_data(client, TPS23881_REG_FOLDBACK);
 	if (ret < 0)
 		return ret;
 
@@ -183,7 +183,7 @@ static int tps23881_pi_enable_manual_pol(struct tps23881_priv *priv, int id)
 	 */
 	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);
+	return i2c_smbus_write_word_data(client, TPS23881_REG_FOLDBACK, val);
 }
 
 static int tps23881_pi_enable(struct pse_controller_dev *pcdev, int id)
-- 
2.43.0


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

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-03 14:44 Kory Maincent [this message]
2026-12-03 14:49 ` [PATCH net] net: pse-pd: tps23881: Fix FOLDBACK register access width 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=20261203144455.473477-1-kory.maincent@bootlin.com \
    --to=kory.maincent@bootlin.com \
    --cc=Phil.Edworthy@addsecure.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=o.rempel@pengutronix.de \
    --cc=pabeni@redhat.com \
    --cc=sashiko-bot@kernel.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