Skip to content

Commit 08da09f

Browse files
zevweissgroeck
authored andcommitted
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]> Cc: [email protected] Link: https://lore.kernel.org/r/[email protected] Fixes: d387d88 ("hwmon: (pmbus) Add Delta AHE-50DC fan control module driver") Signed-off-by: Guenter Roeck <[email protected]>
1 parent 75d2b2b commit 08da09f

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

drivers/hwmon/pmbus/delta-ahe50dc-fan.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,21 @@
1414

1515
#define AHE50DC_PMBUS_READ_TEMP4 0xd0
1616

17+
static int ahe50dc_fan_write_byte(struct i2c_client *client, int page, u8 value)
18+
{
19+
/*
20+
* The CLEAR_FAULTS operation seems to sometimes (unpredictably, perhaps
21+
* 5% of the time or so) trigger a problematic phenomenon in which the
22+
* fan speeds surge momentarily and at least some (perhaps all?) of the
23+
* system's power outputs experience a glitch.
24+
*
25+
* However, according to Delta it should be OK to simply not send any
26+
* CLEAR_FAULTS commands (the device doesn't seem to be capable of
27+
* reporting any faults anyway), so just blackhole them unconditionally.
28+
*/
29+
return value == PMBUS_CLEAR_FAULTS ? -EOPNOTSUPP : -ENODATA;
30+
}
31+
1732
static int ahe50dc_fan_read_word_data(struct i2c_client *client, int page, int phase, int reg)
1833
{
1934
/* temp1 in (virtual) page 1 is remapped to mfr-specific temp4 */
@@ -68,6 +83,7 @@ static struct pmbus_driver_info ahe50dc_fan_info = {
6883
PMBUS_HAVE_VIN | PMBUS_HAVE_FAN12 | PMBUS_HAVE_FAN34 |
6984
PMBUS_HAVE_STATUS_FAN12 | PMBUS_HAVE_STATUS_FAN34 | PMBUS_PAGE_VIRTUAL,
7085
.func[1] = PMBUS_HAVE_TEMP | PMBUS_PAGE_VIRTUAL,
86+
.write_byte = ahe50dc_fan_write_byte,
7187
.read_word_data = ahe50dc_fan_read_word_data,
7288
};
7389

0 commit comments

Comments
 (0)