summaryrefslogtreecommitdiffstats
path: root/drivers/thermal/armada_thermal.c
diff options
context:
space:
mode:
authorMikhail Lappo <mikhail.lappo@esrlabs.com>2018-02-02 19:17:46 +0100
committerZhang Rui <rui.zhang@intel.com>2018-03-14 08:14:40 +0100
commitcf1ba1d73a33944d8c1a75370a35434bf146b8a7 (patch)
tree5d893a5865b7b4a83bed362426c014c9a08a7427 /drivers/thermal/armada_thermal.c
parentLinux 4.16-rc5 (diff)
downloadlinux-cf1ba1d73a33944d8c1a75370a35434bf146b8a7.tar.xz
linux-cf1ba1d73a33944d8c1a75370a35434bf146b8a7.zip
thermal: imx: Fix race condition in imx_thermal_probe()
When device boots with T > T_trip_1 and requests interrupt, the race condition takes place. The interrupt comes before THERMAL_DEVICE_ENABLED is set. This leads to an attempt to reading sensor value from irq and disabling the sensor, based on the data->mode field, which expected to be THERMAL_DEVICE_ENABLED, but still stays as THERMAL_DEVICE_DISABLED. Afher this issue sensor is never re-enabled, as the driver state is wrong. Fix this problem by setting the 'data' members prior to requesting the interrupts. Fixes: 37713a1e8e4c ("thermal: imx: implement thermal alarm interrupt handling") Cc: <stable@vger.kernel.org> Signed-off-by: Mikhail Lappo <mikhail.lappo@esrlabs.com> Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com> Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de> Acked-by: Dong Aisheng <aisheng.dong@nxp.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Diffstat (limited to 'drivers/thermal/armada_thermal.c')
0 files changed, 0 insertions, 0 deletions