Linux Hardware Monitor development
 help / color / mirror / Atom feed
* [PATCH] hwmon: (pmbus) Clear generic status alarms with CLEAR_FAULTS
@ 2026-08-25  6:58 Vishnu Razdan via B4 Relay
  2026-08-25  7:11 ` sashiko-bot
  2026-08-28 15:59 ` Guenter Roeck
  0 siblings, 2 replies; 3+ messages in thread
From: Vishnu Razdan via B4 Relay @ 2026-08-25  6:58 UTC (permalink / raw)
  To: linux; +Cc: vrazdan, linux-hwmon, linux-kernel, vikash.chandola

From: Vishnu Razdan <vrazdan@openai.com>

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.

Fixes: 35f165f08950 ("hwmon: (pmbus) Clear pmbus fault/warning bits after read")
Cc: stable@vger.kernel.org
Assisted-by: LLM
Signed-off-by: Vishnu Razdan <vrazdan@openai.com>
---
 drivers/hwmon/pmbus/pmbus_core.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/hwmon/pmbus/pmbus_core.c b/drivers/hwmon/pmbus/pmbus_core.c
index 806c9a4913bb0..5f69c1420b4e1 100644
--- a/drivers/hwmon/pmbus/pmbus_core.c
+++ b/drivers/hwmon/pmbus/pmbus_core.c
@@ -1275,7 +1275,9 @@ static int pmbus_get_boolean(struct i2c_client *client, struct pmbus_boolean *b,
 
 	regval = status & mask;
 	if (regval) {
-		if (data->revision >= PMBUS_REV_12) {
+		/* Generic STATUS_WORD alarms are not individually clearable. */
+		if (data->revision >= PMBUS_REV_12 &&
+		    reg != PMBUS_STATUS_WORD) {
 			ret = _pmbus_write_byte_data(client, page, reg, regval);
 			if (ret)
 				return ret;

---
base-commit: 83a16909eb64360fd0659f7970665272cdbe65a1
change-id: 20260824-vrazdan-pmbus-status-word-b4-b0d148857741

Best regards,
--  
Vishnu Razdan <vrazdan@openai.com>



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-08-28 15:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-25  6:58 [PATCH] hwmon: (pmbus) Clear generic status alarms with CLEAR_FAULTS Vishnu Razdan via B4 Relay
2026-08-25  7:11 ` sashiko-bot
2026-08-28 15:59 ` Guenter Roeck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox