thermal: exynos: Reading temperature makes sense only when TMU is turned on
authorMarek Szyprowski <m.szyprowski@samsung.com>
Mon, 16 Apr 2018 10:11:52 +0000 (12:11 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 16 May 2018 08:08:44 +0000 (10:08 +0200)
commit3cc96a4acf139c30ff5b4d0312fddaab082db699
tree098f2574f37c0bb0554bb2df8ef8fb1ba9e3f749
parentc7a2c159d6beff177aa9df5037b30a5a9ec08d1b
thermal: exynos: Reading temperature makes sense only when TMU is turned on

commit 88fc6f73fddf64eb507b04f7b2bd01d7291db514 upstream.

When thermal sensor is not yet enabled, reading temperature might return
random value. This might even result in stopping system booting when such
temperature is higher than the critical value. Fix this by checking if TMU
has been actually enabled before reading the temperature.

This change fixes booting of Exynos4210-based board with TMU enabled (for
example Samsung Trats board), which was broken since v4.4 kernel release.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Fixes: 9e4249b40340 ("thermal: exynos: Fix first temperature read after registering sensor")
CC: stable@vger.kernel.org # v4.6+
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/thermal/samsung/exynos_tmu.c