diff options
author | Patrick Rudolph <patrick.rudolph@9elements.com> | 2023-08-17 11:25:24 +0200 |
---|---|---|
committer | Guenter Roeck <linux@roeck-us.net> | 2023-08-21 15:04:31 +0200 |
commit | 14cf45f2f2d56adc061f7b8c9104b56db8d8cb60 (patch) | |
tree | 6be569824cac1882389e2e5426f6f21334326455 /drivers/hwmon | |
parent | hwmon: (nsa320-hwmon) Remove redundant of_match_ptr() (diff) | |
download | linux-14cf45f2f2d56adc061f7b8c9104b56db8d8cb60.tar.xz linux-14cf45f2f2d56adc061f7b8c9104b56db8d8cb60.zip |
hwmon: pmbus: Reduce clear fault page invocations
Observing I2C traffic revealed consecutive transmission of CLEAR_FAULT
commands. While this doesn't cause issues, it extends driver probe time.
Avoid invoking pmbus_clear_fault_page for virtual registers, as they're
managed by the driver, not the chip.
TEST: Verified using an I2C bus analyzer that only one CLEAR_FAULT
command is send instead 5 in a row.
Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Signed-off-by: Naresh Solanki <Naresh.Solanki@9elements.com>
Link: https://lore.kernel.org/r/20230817092527.808631-1-Naresh.Solanki@9elements.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r-- | drivers/hwmon/pmbus/pmbus_core.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/hwmon/pmbus/pmbus_core.c b/drivers/hwmon/pmbus/pmbus_core.c index 69a4e62b6c8d..cbfabdd69056 100644 --- a/drivers/hwmon/pmbus/pmbus_core.c +++ b/drivers/hwmon/pmbus/pmbus_core.c @@ -561,7 +561,8 @@ static bool pmbus_check_register(struct i2c_client *client, rv = pmbus_check_status_cml(client); if (rv < 0 && (data->flags & PMBUS_READ_STATUS_AFTER_FAILED_CHECK)) data->read_status(client, -1); - pmbus_clear_fault_page(client, -1); + if (reg < PMBUS_VIRT_BASE) + pmbus_clear_fault_page(client, -1); return rv >= 0; } |