aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/thermal/ti-soc-thermal/ti-bandgap.h
diff options
context:
space:
mode:
authorTony Lindgren <tony@atomide.com>2021-02-05 15:45:32 +0200
committerDaniel Lezcano <daniel.lezcano@linaro.org>2021-02-15 21:19:15 +0100
commit735c35352aa615026b3544a92ad203da2e551590 (patch)
tree6efc6982539efaf0b9678636f9a675da4b19ba8e /drivers/thermal/ti-soc-thermal/ti-bandgap.h
parentthermal: ti-soc-thermal: Skip pointless register access for dra7 (diff)
downloadlinux-dev-735c35352aa615026b3544a92ad203da2e551590.tar.xz
linux-dev-735c35352aa615026b3544a92ad203da2e551590.zip
thermal: ti-soc-thermal: Fix stuck sensor with continuous mode for 4430
At least for 4430, trying to use the single conversion mode eventually hangs the thermal sensor. This can be quite easily seen with errors: thermal thermal_zone0: failed to read out thermal zone (-5) Also, trying to read the temperature shows a stuck value with: $ while true; do cat /sys/class/thermal/thermal_zone0/temp; done Where the temperature is not rising at all with the busy loop. Additionally, the EOCZ (end of conversion) bit is not rising on 4430 in single conversion mode while it works fine in continuous conversion mode. It is also possible that the hung temperature sensor can affect the thermal shutdown alert too. Let's fix the issue by adding TI_BANDGAP_FEATURE_CONT_MODE_ONLY flag and use it for 4430. Note that we also need to add udelay to for the EOCZ (end of conversion) bit polling as otherwise we have it time out too early on 4430. We'll be changing the loop to use iopoll in the following clean-up patch. Cc: Adam Ford <aford173@gmail.com> Cc: Carl Philipp Klemm <philipp@uvos.xyz> Cc: Eduardo Valentin <edubezval@gmail.com> Cc: H. Nikolaus Schaller <hns@goldelico.com> Cc: Merlijn Wajer <merlijn@wizzup.org> Cc: Pavel Machek <pavel@ucw.cz> Cc: Peter Ujfalusi <peter.ujfalusi@gmail.com> Cc: Sebastian Reichel <sre@kernel.org> Signed-off-by: Tony Lindgren <tony@atomide.com> Tested-by: Adam Ford <aford173@gmail.com> #logicpd-torpedo-37xx-devkit Acked-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Link: https://lore.kernel.org/r/20210205134534.49200-3-tony@atomide.com
Diffstat (limited to 'drivers/thermal/ti-soc-thermal/ti-bandgap.h')
-rw-r--r--drivers/thermal/ti-soc-thermal/ti-bandgap.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/thermal/ti-soc-thermal/ti-bandgap.h b/drivers/thermal/ti-soc-thermal/ti-bandgap.h
index ed0ea4b17b25..1f4bbaf31675 100644
--- a/drivers/thermal/ti-soc-thermal/ti-bandgap.h
+++ b/drivers/thermal/ti-soc-thermal/ti-bandgap.h
@@ -280,6 +280,7 @@ struct ti_temp_sensor {
* has Errata 814
* TI_BANDGAP_FEATURE_UNRELIABLE - used when the sensor readings are too
* inaccurate.
+ * TI_BANDGAP_FEATURE_CONT_MODE_ONLY - used when single mode hangs the sensor
* TI_BANDGAP_HAS(b, f) - macro to check if a bandgap device is capable of a
* specific feature (above) or not. Return non-zero, if yes.
*/
@@ -295,6 +296,7 @@ struct ti_temp_sensor {
#define TI_BANDGAP_FEATURE_HISTORY_BUFFER BIT(9)
#define TI_BANDGAP_FEATURE_ERRATA_814 BIT(10)
#define TI_BANDGAP_FEATURE_UNRELIABLE BIT(11)
+#define TI_BANDGAP_FEATURE_CONT_MODE_ONLY BIT(12)
#define TI_BANDGAP_HAS(b, f) \
((b)->conf->features & TI_BANDGAP_FEATURE_ ## f)