]> www.infradead.org Git - users/jedix/linux-maple.git/commit
hwmon: (pmbus) Conditionally clear individual status bits for pmbus rev >= 1.2
authorPatryk Biel <pbiel7@gmail.com>
Mon, 9 Sep 2024 09:30:28 +0000 (11:30 +0200)
committerGuenter Roeck <linux@roeck-us.net>
Mon, 9 Sep 2024 17:58:09 +0000 (10:58 -0700)
commit20471071f198c8626dbe3951ac9834055b387844
treec338180051491a19ac78124128416ffa5815956a
parentda3ea35007d0af457a0afc87e84fddaebc4e0b63
hwmon: (pmbus) Conditionally clear individual status bits for pmbus rev >= 1.2

The current implementation of pmbus_show_boolean assumes that all devices
support write-back operation of status register to clear pending warnings
or faults. Since clearing individual bits in the status registers was only
introduced in PMBus specification 1.2, this operation may not be supported
by some older devices. This can result in an error while reading boolean
attributes such as temp1_max_alarm.

Fetch PMBus revision supported by the device and modify pmbus_show_boolean
so that it only tries to clear individual status bits if the device is
compliant with PMBus specs >= 1.2. Otherwise clear all fault indicators
on the current page after a fault status was reported.

Fixes: 35f165f08950a ("hwmon: (pmbus) Clear pmbus fault/warning bits after read")
Signed-off-by: Patryk Biel <pbiel7@gmail.com>
Message-ID: <20240909-pmbus-status-reg-clearing-v1-1-f1c0d68c6408@gmail.com>
[groeck:
 Rewrote description
 Moved revision detection code ahead of clear faults command
 Assigned revision if return value from PMBUS_REVISION command is 0
 Improved return value check from calling _pmbus_write_byte_data()]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/pmbus/pmbus.h
drivers/hwmon/pmbus/pmbus_core.c