From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=185.171.202.116 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796309109; b=PNnVgD5UmxxUtY92Iw/10GtY+K6fCfcHK/T+N3hRYxuWILO9l95kxSmpDA3C7ut33y+H jn8mkWkZPLwQKwhqKQalBf16o2GtpwLblYFD7JCijfxEa5JCVYZ/04EUef1bD5l2cNnPu 59Qs/qbmsAHRknWa8pFtRy71Kp9CPonp7/RL2VUt3LhIQX2heMqQnyvES4bPHLbc+8deX z6WyeqO0+k0aH72Vd04nqRMibxHQ8ca0w6Km5En99BWhETAs1rwTsvV01dzCXsN0aeDt/ gx/3h9FeHCwCk+x3cJYth2K2Es40R4et9XA/dElsaH170LK5XUOeSRVue+NC2TuZR+A== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796309109; h=DMARC-Filter:Received:Received:Received:DKIM-Signature:From:To:Cc: Subject:Date:Message-ID:X-Mailer:MIME-Version: Content-Transfer-Encoding:X-Last-TLS-Session-Version; bh=ejXD6c8uMmmZ1VELwYJGNJu6ssI8YiXqu9CbUn/r0YY=; b=WFe1TwPnDgcnwIal9E1ZcR6QxmNv5/JxiUfc8Z7JIWLMekWX5qJ0paybSGv1nyPgzlaj iEFaC9iU0qLI0Icf8dUqSsoVMRMYs6otX90s9vMPLmvGzTAusxj3lo5IfjmSiRxgY+geZ lKXDXq9/fDNrJN9hHYCawq2g+rlc0WTLbjTy/+Fh9GB2QbEH5K97wtPYgafQ6SxAsfOJD FMQAWkZqiX7GLU2CzfnN5uM9poVXZkUB2fvsI9g7x3FQob207dycffL3xBM3n1VmwYanH U2SrwqXzytToY6FcZ4irmclqXPZWf6g8kotBWq+ynL8DUxqK1K45C3TsZA12B/ZCkAg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass header.d=bootlin.com header.i=@bootlin.com header.a=rsa-sha256 header.s=dkim header.b=cKwVnd7H; arc=none smtp.remote-ip=185.171.202.116 Received: from smtpout-04.galae.net (smtpout-04.galae.net [185.171.202.116]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3FB71606A336 for ; Thu, 3 Dec 2026 14:45:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 3FB71606A336 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.a=rsa-sha256 header.s=dkim header.b=cKwVnd7H Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id 9B72FC0133E; Thu, 3 Dec 2026 14:45:18 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 23FB9604ED; Thu, 3 Dec 2026 14:45:07 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 587F411EA188E; Thu, 03 Dec 2026 15:44:57 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1796309102; h=from:subject:date:message-id:to:cc:mime-version: content-transfer-encoding; bh=ejXD6c8uMmmZ1VELwYJGNJu6ssI8YiXqu9CbUn/r0YY=; b=cKwVnd7HQSosBCtJX+eV4I0fmlB984l2L/eL836oq/TAG4l/AmZb/dJAgVQovSex+4qpor 3v9uDdic+dcF+duSRdcshEZOPy9vhQUPX9FvX9hvm+rfGTRlPavPezi+8yO8hGoUYwvRXG f8SADUjAmu3BZmvuypT8F9Dk7bBiJthTXHjYdqVmYxmIE3mbCoiXZ6sAax0kWwb0hT6a+O BO2kgXOp/pMwEiQcRrDYTabSN2ZzWuzK6JvKnxdE4PASGvZpehX8BmrGsjaN9Tc3hXrrYK 52H2yZhA99M+Xo2ht1gG+UjeZZzvxQUKImiMuL5NpBEgU3oXjucXrSvmZqtOdQ== From: Kory Maincent To: Paolo Abeni , Kory Maincent , Oleksij Rempel , Jakub Kicinski , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Phil.Edworthy@addsecure.com, Sashiko , thomas.petazzoni@bootlin.com, Andrew Lunn , "David S. Miller" , Eric Dumazet Subject: [PATCH net] net: pse-pd: tps23881: Fix FOLDBACK register access width Date: Thu, 3 Dec 2026 15:44:51 +0100 Message-ID: <20261203144455.473477-1-kory.maincent@bootlin.com> X-Mailer: git-send-email 2.43.0 X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Last-TLS-Session-Version: TLSv1.3 From: "Kory Maincent (AddSecure)" 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) Fixes: 7f076ce3f1733 ("net: pse-pd: tps23881: Add support for power limit and measurement features") Reported-by: Sashiko 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