hwmon: (pmbus) delta-ahe50dc-fan: work around hardware quirk
Zev Weiss
maintainerPATCH 1/1 hwmon: (pmbus) delta-ahe50dc-fan: work around hardware quirk
CLEAR_FAULTS commands can apparently sometimes trigger catastrophic power output glitches on the ahe-50dc, so block them from being sent at all.
Signed-off-by Zev Weiss <[email protected]>
--- drivers/hwmon/pmbus/delta-ahe50dc-fan.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
drivers/hwmon/pmbus/delta-ahe50dc-fan.c +16 -0
@@ -14,6 +14,21 @@#define AHE50DC_PMBUS_READ_TEMP4 0xd0 +static int ahe50dc_fan_write_byte (struct i2c_client *client,int page,u8 value) +{ +/* +* The CLEAR_FAULTS operation seems to sometimes (unpredictably, perhaps +* 5% of the time or so) trigger a problematic phenomenon in which the +* fan speeds surge momentarily and at least some (perhaps all?) of the +* system's power outputs experience a glitch. +* +* However, according to Delta it should be OK to simply not send any +* CLEAR_FAULTS commands (the device doesn't seem to be capable of +* reporting any faults anyway), so just blackhole them unconditionally. +*/ +return value ==PMBUS_CLEAR_FAULTS ? -EOPNOTSUPP : -ENODATA ; +} +static int ahe50dc_fan_read_word_data (struct i2c_client *client,int page,int phase,int reg) {/* temp1 in (virtual) page 1 is remapped to mfr-specific temp4 */
@@ -68,6 +83,7 @@ static struct pmbus_driver_info ahe50dc_fan_info = {PMBUS_HAVE_VIN |PMBUS_HAVE_FAN12 |PMBUS_HAVE_FAN34 | PMBUS_HAVE_STATUS_FAN12 | PMBUS_HAVE_STATUS_FAN34 | PMBUS_PAGE_VIRTUAL, .func[1] = PMBUS_HAVE_TEMP | PMBUS_PAGE_VIRTUAL, + .write_byte = ahe50dc_fan_write_byte, .read_word_data = ahe50dc_fan_read_word_data, };
Signature · 1 line
2.36.0
Quoted 6 lines · Zev Weiss
CLEAR_FAULTScommands can apparently sometimes trigger catastrophic power output glitches on the ahe-50dc, so block them from being sent at all.Signed-off-by Zev Weiss <[email protected]>
Applied.
Thanks,
Guenter
Quoted 38 lines
--- drivers/hwmon/pmbus/delta-ahe50dc-fan.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)drivers/hwmon/pmbus/delta-ahe50dc-fan.c +16
-0@@ -14,6 +14,21 @@#define AHE50DC_PMBUS_READ_TEMP4 0xd0 +static int ahe50dc_fan_write_byte (struct i2c_client *client,int page,u8 value) +{ +/* +* The CLEAR_FAULTS operation seems to sometimes (unpredictably, perhaps +* 5% of the time or so) trigger a problematic phenomenon in which the +* fan speeds surge momentarily and at least some (perhaps all?) of the +* system's power outputs experience a glitch. +* +* However, according to Delta it should be OK to simply not send any +* CLEAR_FAULTS commands (the device doesn't seem to be capable of +* reporting any faults anyway), so just blackhole them unconditionally. +*/ +return value ==PMBUS_CLEAR_FAULTS ? -EOPNOTSUPP : -ENODATA ; +} +static int ahe50dc_fan_read_word_data (struct i2c_client *client,int page,int phase,int reg) {/* temp1 in (virtual) page 1 is remapped to mfr-specific temp4 */ @@ -68,6 +83,7 @@ static struct pmbus_driver_info ahe50dc_fan_info = {PMBUS_HAVE_VIN |PMBUS_HAVE_FAN12 |PMBUS_HAVE_FAN34 | PMBUS_HAVE_STATUS_FAN12 | PMBUS_HAVE_STATUS_FAN34 | PMBUS_PAGE_VIRTUAL, .func[1] = PMBUS_HAVE_TEMP | PMBUS_PAGE_VIRTUAL, + .write_byte = ahe50dc_fan_write_byte, .read_word_data = ahe50dc_fan_read_word_data, };