Re: [PATCH v3 2/2] hwmon: (pmbus) Clear only CML command and data faults during probe

From: Guenter Roeck

Date: Fri Nov 20 2026 - 14:28:52 EST


On Fri, Nov 20, 2026 at 02:44:16AM +0000, Arthur Korn wrote:
> During driver initialization, register capability probing, and SMBALERT
> mask setup, pmbus_core and the generic pmbus driver send CLEAR_FAULTS
> (0x03) to clear any communication or command faults triggered while
> probing unsupported commands or out-of-range page/register operands.
> However, CLEAR_FAULTS unconditionally clears all latched fault status
> bits across the device, including hardware power fault registers such as
> STATUS_WORD, STATUS_VOUT, STATUS_IOUT, and STATUS_MFR_SPECIFIC. As a
> result, a BMC reboot or driver re-probe erases pre-existing voltage
> regulator fault telemetry before monitoring or diagnostic tools can
> inspect it.
>
> Simply omitting fault clearing during probe is not viable because
> probing unsupported commands asserts PB_CML_FAULT_INVALID_COMMAND in
> STATUS_CML (causing pmbus_check_status_cml() to fail subsequent checks
> with -EIO), and probing out-of-range PMBUS_PAGE or PMBUS_SMBALERT_MASK
> operands asserts PB_CML_FAULT_INVALID_DATA and PB_STATUS_CML.
>
> Starting with PMBus Revision 1.2, individual bits in STATUS_CML can be
> cleared via Write-1-to-Clear (W1C), a mechanism pmbus_core already uses
> in pmbus_get_boolean(). Introduce pmbus_clear_cml_fault() and export
> pmbus_clear_cml_faults() in the "PMBUS" module namespace to clear
> PB_CML_FAULT_INVALID_COMMAND | PB_CML_FAULT_INVALID_DATA in
> PMBUS_STATUS_CML during device initialization, register probing,
> pmbus_write_smbalert_mask(), and pmbus_identify() while preserving all
> other latched fault bits:
>
> - Verify during pmbus_init_common() that PMBUS_REVISION is valid (>= 1.2
> and not 0xff), that the driver does not hook write_byte() without
> write_byte_data(), and that PMBUS_STATUS_CML is readable before
> enabling STATUS_CML W1C clearing.
> - Fall back to pmbus_clear_fault_page() when STATUS_CML W1C is
> unavailable or if writing PMBUS_STATUS_CML fails.
>
> Tested on BMC hardware across 130 hwmon devices (105 PMBus devices
> covering tda38740/xdpe1a2g5b, isl68137/raa228234, adm1266,
> ltc4286/ltc4287, and generic pmbus regulators including TI
> tps546e25/tps546b25 and factory write-protected converters), verifying
> clean probing with no -EIO regressions, preservation of non-CML status
> faults across re-binds, and fallback when writing PMBUS_STATUS_CML is
> NACKed.
>
> Signed-off-by: Arthur Korn <akorn@xxxxxxxxxx>

Applied.

Thanks,
Guenter