summaryrefslogtreecommitdiff
path: root/drivers/thermal/imx_thermal.c
diff options
context:
space:
mode:
authorTim Harvey <tharvey@gateworks.com>2015-06-09 06:40:22 -0700
committerStefano Babic <sbabic@denx.de>2015-07-10 09:23:32 +0200
commit3b7ad216e26567342162722fca7b2e142e694d0f (patch)
treef25bec9f2161ea6ab88af09835b5f399411bc909 /drivers/thermal/imx_thermal.c
parent1254ff97abb7606ccd0d7bdcd9f22581c50fe535 (diff)
thermal:imx_thermal: enter busywait cooling loop when over max CPU temp
Remove the check for temperature being within the min/max range and enter the busywait cooling loop whenever the CPU temperature is over the critical temp. This fixes the issue where if a board was booted at a temp greater than the CPU temperature max, it would skip the loop and never indicate or try to address the overtemp issue. Cc: Ye Li <b37916@freescale.com> Cc: Jason Liu <r64343@freescale.com> Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Diffstat (limited to 'drivers/thermal/imx_thermal.c')
-rw-r--r--drivers/thermal/imx_thermal.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/drivers/thermal/imx_thermal.c b/drivers/thermal/imx_thermal.c
index 0d893c9d06..42ca8d0b6b 100644
--- a/drivers/thermal/imx_thermal.c
+++ b/drivers/thermal/imx_thermal.c
@@ -130,16 +130,12 @@ int imx_thermal_get_temp(struct udevice *dev, int *temp)
int cpu_tmp = 0;
cpu_tmp = read_cpu_temperature(dev);
- while (cpu_tmp > priv->minc && cpu_tmp < priv->maxc) {
- if (cpu_tmp >= priv->critical) {
- printf("CPU Temperature (%dC) too close to max (%dC)",
- cpu_tmp, priv->maxc);
- puts(" waiting...\n");
- udelay(5000000);
- cpu_tmp = read_cpu_temperature(dev);
- } else {
- break;
- }
+ while (cpu_tmp >= priv->critical) {
+ printf("CPU Temperature (%dC) too close to max (%dC)",
+ cpu_tmp, priv->maxc);
+ puts(" waiting...\n");
+ udelay(5000000);
+ cpu_tmp = read_cpu_temperature(dev);
}
*temp = cpu_tmp;