]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
hwmon: (lm90) Fix max6658 sporadic wrong temperature reading
authorBoyang Yu <byu@arista.com>
Fri, 28 Jun 2019 19:06:36 +0000 (19:06 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Mar 2021 15:34:35 +0000 (16:34 +0100)
commite8a6799d81fd00e8d9755640bf91c192d0c1f79f
tree79afe5e4424fa032c22d26f4967c5e6d7c1202ad
parent4a8b4124ea4156ca52918b66c750a69c6d932aa5
hwmon: (lm90) Fix max6658 sporadic wrong temperature reading

commit 62456189f3292c62f87aef363f204886dc1d4b48 upstream.

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>
Cc: Paul Menzel <pmenzel@molgen.mpg.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hwmon/lm90.c