Re: [PATCH v2] hwmon: (pmbus) Fall back to CLEAR_FAULTS when STATUS_CML is read-only

From: Guenter Roeck

Date: Wed Nov 25 2026 - 20:47:44 EST


On Wed, Nov 25, 2026 at 06:13:35PM +0000, Arthur Korn wrote:
> Some PMBus 1.2 devices (such as ADI ADM1273 and ADM1281) report
> PMBUS_REVISION = 0x22 and implement STATUS_CML (0x7e) as read-only:
> they ACK SMBus byte writes to PMBUS_STATUS_CML without clearing latched
> fault bits, and only clear STATUS_CML via CLEAR_FAULTS (0x03).
>
> During pmbus_init_common(), probing an unsupported register such as
> PMBUS_WRITE_PROTECT (0x10) latches PB_CML_FAULT_INVALID_COMMAND in
> STATUS_CML. When pmbus_clear_cml_fault() writes to PMBUS_STATUS_CML and
> sees ret == 0, PB_CML_FAULT_INVALID_COMMAND remains latched, causing
> subsequent pmbus_check_status_cml() calls during attribute discovery to
> fail with -EIO.
>
> Verify on non-write-protected devices that PB_CML_FAULT_INVALID_COMMAND
> and PB_CML_FAULT_INVALID_DATA actually cleared when a CML fault is
> expected or cleared unconditionally. If the write succeeds and either
> bit remains set on readback, disable STATUS_CML write-1-to-clear for the
> device and fall back to pmbus_clear_fault_page(). Do not clear
> has_status_cml when _pmbus_write_byte_data() returns an error, so
> per-page write failures (such as -EOPNOTSUPP on read-only virtual pages
> like max16601 page 1) fall back for that page without disabling
> STATUS_CML write-1-to-clear on other pages. Skipping the readback on
> supported register probes (rv >= 0) avoids extra SMBus traffic in the
> common path.
>
> Tested on BMC hardware across ADI ADM1273-1A (adm1275), Maxim
> MAX16600B.04 (max16601, 3 virtual pages across VCORE, sensor IIN/PIN,
> and VSA), Renesas RAA228234 (isl68137), Infineon XDPE1A2G5B (tda38740),
> ADI ADM1266, and factory write-protected converters.
>
> Fixes: d9d30e1cb9ca ("hwmon: (pmbus) Clear only CML command and data faults during probe")
> Signed-off-by: Arthur Korn <akorn@xxxxxxxxxx>

Applied.

Thanks,
Guenter