Skip to content

Commit

Permalink
hwmon: pmbus: Reduce clear fault page invocations
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Patrick Rudolph authored and Guenter Roeck committed Aug 21, 2023
1 parent 7d9be29 commit 14cf45f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/hwmon/pmbus/pmbus_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 14cf45f

Please sign in to comment.