* [PATCH] thermal: imx_scu_thermal: prevent boot hang with zero pdata
@ 2020-05-20 8:21 Anatolij Gustschin
2020-05-22 21:15 ` Anatolij Gustschin
0 siblings, 1 reply; 2+ messages in thread
From: Anatolij Gustschin @ 2020-05-20 8:21 UTC (permalink / raw)
To: u-boot
Should initialization of pdata values have failed for some reason,
we end up in endless loop when getting the CPU temperature value
and can not boot. Check alert value in pdata and only retry reading
temperature if alert value is not zero. Also shorten the temperature
info string.
Signed-off-by: Anatolij Gustschin <agust@denx.de>
---
drivers/thermal/imx_scu_thermal.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/thermal/imx_scu_thermal.c b/drivers/thermal/imx_scu_thermal.c
index 321f905e3a..83ec753802 100644
--- a/drivers/thermal/imx_scu_thermal.c
+++ b/drivers/thermal/imx_scu_thermal.c
@@ -61,13 +61,15 @@ int imx_sc_thermal_get_temp(struct udevice *dev, int *temp)
return ret;
while (cpu_temp >= pdata->alert) {
- printf("CPU Temperature (%dC) has beyond alert (%dC), close to critical (%dC)",
+ printf("CPU Temperature (%dC) beyond alert (%dC), close to critical (%dC)",
cpu_temp, pdata->alert, pdata->critical);
puts(" waiting...\n");
mdelay(pdata->polling_delay);
ret = read_temperature(dev, &cpu_temp);
if (ret)
return ret;
+ if (cpu_temp >= pdata->alert && !pdata->alert)
+ break;
}
*temp = cpu_temp / 1000;
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH] thermal: imx_scu_thermal: prevent boot hang with zero pdata
2020-05-20 8:21 [PATCH] thermal: imx_scu_thermal: prevent boot hang with zero pdata Anatolij Gustschin
@ 2020-05-22 21:15 ` Anatolij Gustschin
0 siblings, 0 replies; 2+ messages in thread
From: Anatolij Gustschin @ 2020-05-22 21:15 UTC (permalink / raw)
To: u-boot
On Wed, 20 May 2020 10:21:53 +0200
Anatolij Gustschin agust at denx.de wrote:
> Should initialization of pdata values have failed for some reason,
> we end up in endless loop when getting the CPU temperature value
> and can not boot. Check alert value in pdata and only retry reading
> temperature if alert value is not zero. Also shorten the temperature
> info string.
>
> Signed-off-by: Anatolij Gustschin <agust@denx.de>
> ---
> drivers/thermal/imx_scu_thermal.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
Applied.
--
Anatolij
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-05-22 21:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-20 8:21 [PATCH] thermal: imx_scu_thermal: prevent boot hang with zero pdata Anatolij Gustschin
2020-05-22 21:15 ` Anatolij Gustschin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox