Skip to contentSkip to conversation

hwmon: (pmbus) Add Vin unit off handling

PATCH Applied Brandon Wyman 2 participants 3 messages Mar 17, 2022 – Mar 19, 2022 Hardware monitoring

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hwmon: (pmbus) Add Vin unit off handling

If there is an input undervoltage fault, reported in STATUS_INPUT command response, there is quite likely a "Unit Off For Insufficient Input Voltage" condition as well.

Add a constant for bit 3 of STATUS_INPUT. Update the Vin limit attributes to include both bits in the mask for clearing faults.

If an input undervoltage fault occurs, causing a unit off for insufficient input voltage, but the unit is off bit is not cleared, the STATUS_WORD will not be updated to clear the input fault condition. Including the unit is off bit (bit 3) allows for the input fault condition to completely clear.

---
 drivers/hwmon/pmbus/pmbus.h      | 1 +
 drivers/hwmon/pmbus/pmbus_core.c | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)
drivers/hwmon/pmbus/pmbus.h +1 -0
index e0aa8aa46d8c..ef3a8ecde4df 100644
@@ -319,6 +319,7 @@ enum pmbus_fan_mode { percent = 0, rpm };
 /*
  * STATUS_VOUT, STATUS_INPUT
  */
+#define PB_VOLTAGE_VIN_OFF		BIT(3)
 #define PB_VOLTAGE_UV_FAULT		BIT(4)
 #define PB_VOLTAGE_UV_WARNING		BIT(5)
 #define PB_VOLTAGE_OV_WARNING		BIT(6)
drivers/hwmon/pmbus/pmbus_core.c +1 -1
index ac2fbee1ba9c..a0d899dc81f0 100644
@@ -1373,7 +1373,7 @@ static const struct pmbus_limit_attr vin_limit_attrs[] = {
 		.reg = PMBUS_VIN_UV_FAULT_LIMIT,
 		.attr = "lcrit",
 		.alarm = "lcrit_alarm",
-		.sbit = PB_VOLTAGE_UV_FAULT,
+		.sbit = (PB_VOLTAGE_UV_FAULT | PB_VOLTAGE_VIN_OFF),
 	}, {
 		.reg = PMBUS_VIN_OV_WARN_LIMIT,
 		.attr = "max",
Signature · 1 line
2.25.1
maintainer Applied
#1 lore raw
Quoted 7 lines · Brandon Wyman

If there is an input undervoltage fault, reported in STATUS_INPUT command response, there is quite likely a "Unit Off For Insufficient Input Voltage" condition as well.

Add a constant for bit 3 of STATUS_INPUT. Update the Vin limit attributes to include both bits in the mask for clearing faults.

Quoted 7 lines

If an input undervoltage fault occurs, causing a unit off for insufficient input voltage, but the unit is off bit is not cleared, the STATUS_WORD will not be updated to clear the input fault condition. Including the unit is off bit (bit 3) allows for the input fault condition to completely clear.

Applied.

Thanks,
Guenter

Quoted 30 lines
---
 drivers/hwmon/pmbus/pmbus.h      | 1 +
 drivers/hwmon/pmbus/pmbus_core.c | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)
drivers/hwmon/pmbus/pmbus.h +1 -0
index e0aa8aa46d8c..ef3a8ecde4df 100644
@@ -319,6 +319,7 @@ enum pmbus_fan_mode { percent = 0, rpm };
 /*
  * STATUS_VOUT, STATUS_INPUT
  */
+#define PB_VOLTAGE_VIN_OFF		BIT(3)
 #define PB_VOLTAGE_UV_FAULT		BIT(4)
 #define PB_VOLTAGE_UV_WARNING		BIT(5)
 #define PB_VOLTAGE_OV_WARNING		BIT(6)
drivers/hwmon/pmbus/pmbus_core.c +1 -1
index ac2fbee1ba9c..a0d899dc81f0 100644
@@ -1373,7 +1373,7 @@ static const struct pmbus_limit_attr vin_limit_attrs[] = {
 		.reg = PMBUS_VIN_UV_FAULT_LIMIT,
 		.attr = "lcrit",
 		.alarm = "lcrit_alarm",
-		.sbit = PB_VOLTAGE_UV_FAULT,
+		.sbit = (PB_VOLTAGE_UV_FAULT | PB_VOLTAGE_VIN_OFF),
 	}, {
 		.reg = PMBUS_VIN_OV_WARN_LIMIT,
 		.attr = "max",
#2 lore raw

Joel,

Can you merge this, and the dependent patch to the openbmc/linux kernel?

Dependent patch is in v5.17-rc6 or later kernels: 35f165f08950 (""hwmon: (pmbus) Clear pmbus fault/warning bits after read").

Quoted 50 lines · Guenter Roeck
Quoted 7 lines · Brandon Wyman

If there is an input undervoltage fault, reported in STATUS_INPUT command response, there is quite likely a "Unit Off For Insufficient Input Voltage" condition as well.

Add a constant for bit 3 of STATUS_INPUT. Update the Vin limit attributes to include both bits in the mask for clearing faults.

Quoted 7 lines

If an input undervoltage fault occurs, causing a unit off for insufficient input voltage, but the unit is off bit is not cleared, the STATUS_WORD will not be updated to clear the input fault condition. Including the unit is off bit (bit 3) allows for the input fault condition to completely clear.

Applied.

Thanks,
Guenter

Quoted 30 lines
---
  drivers/hwmon/pmbus/pmbus.h      | 1 +
  drivers/hwmon/pmbus/pmbus_core.c | 2 +-
  2 files changed, 2 insertions(+), 1 deletion(-)
drivers/hwmon/pmbus/pmbus.h +1 -0
index e0aa8aa46d8c..ef3a8ecde4df 100644
@@ -319,6 +319,7 @@ enum pmbus_fan_mode { percent = 0, rpm };
  /*
   * STATUS_VOUT, STATUS_INPUT
   */
+#define PB_VOLTAGE_VIN_OFF		BIT(3)
  #define PB_VOLTAGE_UV_FAULT		BIT(4)
  #define PB_VOLTAGE_UV_WARNING		BIT(5)
  #define PB_VOLTAGE_OV_WARNING		BIT(6)
drivers/hwmon/pmbus/pmbus_core.c +1 -1
index ac2fbee1ba9c..a0d899dc81f0 100644
@@ -1373,7 +1373,7 @@ static const struct pmbus_limit_attr vin_limit_attrs[] = {
  		.reg = PMBUS_VIN_UV_FAULT_LIMIT,
  		.attr = "lcrit",
  		.alarm = "lcrit_alarm",
-		.sbit = PB_VOLTAGE_UV_FAULT,
+		.sbit = (PB_VOLTAGE_UV_FAULT | PB_VOLTAGE_VIN_OFF),
  	}, {
  		.reg = PMBUS_VIN_OV_WARN_LIMIT,
  		.attr = "max",