hwmon: (lm90) Fix max6658 sporadic wrong temperature reading
authorBoyang Yu <byu@arista.com>
Fri, 28 Jun 2019 19:06:36 +0000 (19:06 +0000)
committerGuenter Roeck <linux@roeck-us.net>
Tue, 9 Jul 2019 01:11:30 +0000 (18:11 -0700)
commit62456189f3292c62f87aef363f204886dc1d4b48
treecefaae1ced23fbf53a7e114b0343d3a1584c322a
parenta653acf00d07430bbb0af06a4f5cc2073bbefde7
hwmon: (lm90) Fix max6658 sporadic wrong temperature reading

max6658 may report unrealistically high temperature during
the driver initialization, for which, its overtemp alarm pin
also gets asserted. For certain devices implementing overtemp
protection based on that pin, it may further trigger a reset to
the device. By reproducing the problem, the wrong reading is
found to be coincident with changing the conversion rate.

To mitigate this issue, set the stop bit before changing the
conversion rate and unset it thereafter. After such change, the
wrong reading is not reproduced. Apply this change only to the
max6657 kind for now, controlled by flag LM90_PAUSE_ON_CONFIG.

Signed-off-by: Boyang Yu <byu@arista.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/lm90.c