Devicetree
 help / color / mirror / Atom feed
From: "Pradhan, Sanman" <sanman.pradhan@hpe.com>
To: Guenter Roeck <linux@roeck-us.net>
Cc: Jonathan Corbet <corbet@lwn.net>, Rob Herring <robh@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	"linux-hwmon@vger.kernel.org" <linux-hwmon@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-doc@vger.kernel.org" <linux-doc@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>,
	Sanman Pradhan <psanman@juniper.net>
Subject: [PATCH v2 2/2] hwmon: (pmbus/tps53679) Select page 0 for single-page TPS536C7
Date: Wed, 16 Sep 2026 23:54:21 +0000	[thread overview]
Message-ID: <20260916235406.681131-3-sanman.pradhan@hpe.com> (raw)
In-Reply-To: <20260916235406.681131-1-sanman.pradhan@hpe.com>

From: Sanman Pradhan <psanman@juniper.net>

tps536c7_identify() sets info->pages to 1 for a single-channel part and
then accesses page 0 (writing PMBUS_PHASE) without ensuring PAGE is
actually 0. pmbus_set_page() does not update the PAGE register when
info->pages is 1, so if boot firmware left PAGE set to another value the
PHASE writes and subsequent telemetry may target the wrong page.

Select page 0 explicitly before configuring PHASE.

Signed-off-by: Sanman Pradhan <psanman@juniper.net>
---
 drivers/hwmon/pmbus/tps53679.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/hwmon/pmbus/tps53679.c b/drivers/hwmon/pmbus/tps53679.c
index 4f91b0a43ad0..df21bc5aa128 100644
--- a/drivers/hwmon/pmbus/tps53679.c
+++ b/drivers/hwmon/pmbus/tps53679.c
@@ -284,6 +284,17 @@ static int tps536c7_identify(struct i2c_client *client,
 	 */
 	info->pages = phases_b ? 2 : 1;
 
+	/*
+	 * pmbus_set_page() does not update the PAGE register on single-page
+	 * devices, so select page 0 explicitly in case the boot firmware
+	 * left the device on another page.
+	 */
+	if (info->pages == 1) {
+		ret = i2c_smbus_write_byte_data(client, PMBUS_PAGE, 0);
+		if (ret < 0)
+			return ret;
+	}
+
 	/*
 	 * With info->phases[] left unset the PMBus core never programs the
 	 * PHASE selector, so make sure each page reports the aggregate
-- 
2.34.1


  parent reply	other threads:[~2026-09-16 23:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-16 23:54 [PATCH v2 0/2] hwmon: (pmbus/tps53679) Select page 0 for single-page parts Pradhan, Sanman
2026-09-16 23:54 ` [PATCH v2 1/2] hwmon: (pmbus/tps53679) Select page 0 for single-page TPS53676 Pradhan, Sanman
2026-09-17  0:05   ` Guenter Roeck
2026-09-16 23:54 ` Pradhan, Sanman [this message]
2026-09-17  0:06   ` [PATCH v2 2/2] hwmon: (pmbus/tps53679) Select page 0 for single-page TPS536C7 Guenter Roeck

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=20260916235406.681131-3-sanman.pradhan@hpe.com \
    --to=sanman.pradhan@hpe.com \
    --cc=conor+dt@kernel.org \
    --cc=corbet@lwn.net \
    --cc=devicetree@vger.kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=psanman@juniper.net \
    --cc=robh@kernel.org \
    --cc=stable@vger.kernel.org \
    /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