Skip to content

Commit 43cba96

Browse files
dnbazhenovgregkh
authored andcommitted
hwmon: (pmbus) Fix page count auto-detection.
commit e7c6a55 upstream. Devices with compatible="pmbus" field have zero initial page count, and pmbus_clear_faults() being called before the page count auto- detection does not actually clear faults because it depends on the page count. Non-cleared faults in its turn may fail the subsequent page count auto-detection. This patch fixes this problem by calling pmbus_clear_fault_page() for currently set page and calling pmbus_clear_faults() after the page count was detected. Cc: [email protected] Signed-off-by: Dmitry Bazhenov <[email protected]> Signed-off-by: Guenter Roeck <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent e52ad8e commit 43cba96

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

drivers/hwmon/pmbus/pmbus.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,8 @@ static int pmbus_identify(struct i2c_client *client,
118118
} else {
119119
info->pages = 1;
120120
}
121+
122+
pmbus_clear_faults(client);
121123
}
122124

123125
if (pmbus_check_byte_register(client, 0, PMBUS_VOUT_MODE)) {

drivers/hwmon/pmbus/pmbus_core.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2015,7 +2015,10 @@ static int pmbus_init_common(struct i2c_client *client, struct pmbus_data *data,
20152015
if (ret >= 0 && (ret & PB_CAPABILITY_ERROR_CHECK))
20162016
client->flags |= I2C_CLIENT_PEC;
20172017

2018-
pmbus_clear_faults(client);
2018+
if (data->info->pages)
2019+
pmbus_clear_faults(client);
2020+
else
2021+
pmbus_clear_fault_page(client, -1);
20192022

20202023
if (info->identify) {
20212024
ret = (*info->identify)(client, info);

0 commit comments

Comments
 (0)