From: Sanman Pradhan tps53676_identify() derives the number of PMBus pages but does not ensure that page 0 is selected for single-page configurations. pmbus_set_page() does not update the PAGE register when info->pages is 1, so if boot firmware leaves PAGE set to another value subsequent register accesses may target the wrong page. For single-page devices, select page 0 explicitly. Fixes: cb3d37b59012 ("hwmon: (pmbus/tps53679) Add support for TI TPS53676") Cc: stable@vger.kernel.org Signed-off-by: Sanman Pradhan --- drivers/hwmon/pmbus/tps53679.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/hwmon/pmbus/tps53679.c b/drivers/hwmon/pmbus/tps53679.c index dcd4250b679d..4f91b0a43ad0 100644 --- a/drivers/hwmon/pmbus/tps53679.c +++ b/drivers/hwmon/pmbus/tps53679.c @@ -246,6 +246,15 @@ static int tps53676_identify(struct i2c_client *client, if (phases_b > 0) { info->pages = 2; info->phases[1] = phases_b; + } else { + /* + * 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. + */ + ret = i2c_smbus_write_byte_data(client, PMBUS_PAGE, 0); + if (ret < 0) + return ret; } return 0; -- 2.34.1 From: Sanman Pradhan 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 --- 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