hwmon: (pmbus) Fix page count auto-detection.
authorDmitry Bazhenov <bazhenov.dn@gmail.com>
Mon, 15 Oct 2018 09:21:22 +0000 (14:21 +0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 13 Nov 2018 19:16:45 +0000 (11:16 -0800)
commit4f173e6911cd68a4ace5c9311b4f6d9f804ec568
tree997384b45aa2cf07fc09ce913b77c7777d35696d
parent0d38b80894bfdda08f900299023f0e1118be68b7
hwmon: (pmbus) Fix page count auto-detection.

commit e7c6a55606b5c46b449d76588968b4d8caae903f upstream.

Devices with compatible="pmbus" field have zero initial page count,
and pmbus_clear_faults() being called before the page count auto-
detection does not actually clear faults because it depends on the
page count. Non-cleared faults in its turn may fail the subsequent
page count auto-detection.

This patch fixes this problem by calling pmbus_clear_fault_page()
for currently set page and calling pmbus_clear_faults() after the
page count was detected.

Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Bazhenov <bazhenov.dn@gmail.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hwmon/pmbus/pmbus.c
drivers/hwmon/pmbus/pmbus_core.c