* [U-Boot] [PATCH] thermal:imx_thermal: enter busywait cooling loop when over max CPU temp
@ 2015-06-09 13:40 Tim Harvey
2015-07-08 22:46 ` Tim Harvey
0 siblings, 1 reply; 3+ messages in thread
From: Tim Harvey @ 2015-06-09 13:40 UTC (permalink / raw)
To: u-boot
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>
---
drivers/thermal/imx_thermal.c | 16 ++++++----------
1 file changed, 6 insertions(+), 10 deletions(-)
diff --git a/drivers/thermal/imx_thermal.c b/drivers/thermal/imx_thermal.c
index 0d893c9..42ca8d0 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;
--
1.9.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [U-Boot] [PATCH] thermal:imx_thermal: enter busywait cooling loop when over max CPU temp
2015-06-09 13:40 [U-Boot] [PATCH] thermal:imx_thermal: enter busywait cooling loop when over max CPU temp Tim Harvey
@ 2015-07-08 22:46 ` Tim Harvey
2015-07-10 7:24 ` Stefano Babic
0 siblings, 1 reply; 3+ messages in thread
From: Tim Harvey @ 2015-07-08 22:46 UTC (permalink / raw)
To: u-boot
On Tue, Jun 9, 2015 at 6:40 AM, Tim Harvey <tharvey@gateworks.com> wrote:
> 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>
> ---
> drivers/thermal/imx_thermal.c | 16 ++++++----------
> 1 file changed, 6 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/thermal/imx_thermal.c b/drivers/thermal/imx_thermal.c
> index 0d893c9..42ca8d0 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;
> --
> 1.9.1
>
Stefano,
Any feedback on this?
Regards,
Tim
^ permalink raw reply [flat|nested] 3+ messages in thread
* [U-Boot] [PATCH] thermal:imx_thermal: enter busywait cooling loop when over max CPU temp
2015-07-08 22:46 ` Tim Harvey
@ 2015-07-10 7:24 ` Stefano Babic
0 siblings, 0 replies; 3+ messages in thread
From: Stefano Babic @ 2015-07-10 7:24 UTC (permalink / raw)
To: u-boot
Hi Tim,
On 09/07/2015 00:46, Tim Harvey wrote:
> On Tue, Jun 9, 2015 at 6:40 AM, Tim Harvey <tharvey@gateworks.com> wrote:
>> 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>
>> ---
>> drivers/thermal/imx_thermal.c | 16 ++++++----------
>> 1 file changed, 6 insertions(+), 10 deletions(-)
>>
>> diff --git a/drivers/thermal/imx_thermal.c b/drivers/thermal/imx_thermal.c
>> index 0d893c9..42ca8d0 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;
>> --
>> 1.9.1
>>
>
> Stefano,
>
> Any feedback on this?
Sure !
Applied to u-boot-imx, thanks !
Best regards,
Stefano Babic
--
=====================================================================
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-07-10 7:24 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-09 13:40 [U-Boot] [PATCH] thermal:imx_thermal: enter busywait cooling loop when over max CPU temp Tim Harvey
2015-07-08 22:46 ` Tim Harvey
2015-07-10 7:24 ` Stefano Babic
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox