History

hwmon: (pmbus) Clear generic status alarms with CLEAR_FAULTS

Some hwmon alarms fall back to STATUS_WORD summary bits when no individual limit alarm is available. On PMBus 1.2 and newer devices, pmbus_get_boolean() acknowledges these alarms with the same byte-data write used for detailed status registers. For example, PB_STATUS_INPUT is 0x2000, so it is truncated to zero when passed to _pmbus_write_byte_data(). The resulting write cannot acknowledge the input alarm. PMBus 1.3 Part II, sections 10.2.4 and 10.2.5, excludes ordinary STATUS_BYTE and STATUS_WORD summary bits from individual clearing. Their summary bits clear when the underlying status bits clear, so changing this to a word-data write would not fix the generic input alarm either. Use the existing page CLEAR_FAULTS path for generic STATUS_WORD alarms, including devices whose status accessor uses STATUS_BYTE. Keep individual byte writes for detailed status registers on PMBus 1.2 and newer devices. As with the existing older-device fallback, CLEAR_FAULTS can clear other latched status; an active condition can reassert its status.

Vishnu Razdan committed 2 months ago

Commit 6d760f81 parent 286b1751 file · +3 −1Browse files

Unified · Split

drivers/hwmon/pmbus/pmbus_core.c+3−1
@@ -1275,7 +1275,9 @@ static int pmbus_get_boolean(struct i2c_client *client, struct pmbus_boolean *b, · 1274 unmodified lines
12751275
12761276 regval = status & mask;
12771277 if (regval) {
1278− if (data->revision >= PMBUS_REV_12) {
1278+ /* Generic STATUS_WORD alarms are not individually clearable. */
1279+ if (data->revision >= PMBUS_REV_12 &&
1280+ reg != PMBUS_STATUS_WORD) {
12791281 ret = _pmbus_write_byte_data(client, page, reg, regval);
12801282 if (ret)
12811283 return ret;