public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
* Re: PROBLEM:  ACPI Thermal Zone for CPU0 does not update after hibernation
       [not found] <11584.192.146.101.26.1175890435.squirrel@panacea.theblackmoor.net>
@ 2007-04-10  0:47 ` Andrew Morton
  2007-04-10  1:47   ` Walter Francis
  0 siblings, 1 reply; 4+ messages in thread
From: Andrew Morton @ 2007-04-10  0:47 UTC (permalink / raw)
  To: wally; +Cc: linux-kernel, Jung-Ik (John) Lee, linux-acpi

On Fri, 6 Apr 2007 16:13:55 -0400 (EDT)
"Walter Francis" <wally@theblackmoor.net> wrote:

> After hibernating, the CPU0 thermal zone never updates.  It will stay at 59C
> forever for example.
> 
> I've tried making the thermal driver a module and unloading it before
> hibernating and it didn't help, also went back as far as 2.6.19 and saw the
> same behavior there.  Currently using 2.6.21-pre6.  If I reboot or suspend to
> *RAM*, the problem fixes itself.  And CPU1's thermal zone is fine.  But CPU0
> if it's (example) 59C, it stays 59C forever.  I'm seeing it in gkrellm, but
> it's coming from /proc/acpi/thermal_zone/*/temperature and verified to match
> there.

Yeah, John spotted a bug in there the other day.

Does this fix it?

--- a/drivers/acpi/thermal.c~acpi-thermal-fix-mod_timer-interval
+++ a/drivers/acpi/thermal.c
@@ -758,7 +758,8 @@ static void acpi_thermal_check(void *dat
 			del_timer(&(tz->timer));
 	} else {
 		if (timer_pending(&(tz->timer)))
-			mod_timer(&(tz->timer), (HZ * sleep_time) / 1000);
+			mod_timer(&(tz->timer),
+					jiffies + (HZ * sleep_time) / 1000);
 		else {
 			tz->timer.data = (unsigned long)tz;
 			tz->timer.function = acpi_thermal_run;
_


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: PROBLEM:  ACPI Thermal Zone for CPU0 does not update after    hibernation
  2007-04-10  0:47 ` PROBLEM: ACPI Thermal Zone for CPU0 does not update after hibernation Andrew Morton
@ 2007-04-10  1:47   ` Walter Francis
  2007-04-10  1:57     ` Andrew Morton
  0 siblings, 1 reply; 4+ messages in thread
From: Walter Francis @ 2007-04-10  1:47 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel, Jung-Ik Lee, linux-acpi

> On Fri, 6 Apr 2007 16:13:55 -0400 (EDT)
> "Walter Francis" <wally@theblackmoor.net> wrote:

>> After hibernating, the CPU0 thermal zone never updates.  It will stay at 59C
>> forever for example.

> Yeah, John spotted a bug in there the other day.
>
> Does this fix it?
>
> --- a/drivers/acpi/thermal.c~acpi-thermal-fix-mod_timer-interval
> +++ a/drivers/acpi/thermal.c
> @@ -758,7 +758,8 @@ static void acpi_thermal_check(void *dat
>  			del_timer(&(tz->timer));
>  	} else {
>  		if (timer_pending(&(tz->timer)))
> -			mod_timer(&(tz->timer), (HZ * sleep_time) / 1000);
> +			mod_timer(&(tz->timer),
> +					jiffies + (HZ * sleep_time) / 1000);
>  		else {
>  			tz->timer.data = (unsigned long)tz;
>  			tz->timer.function = acpi_thermal_run;

No joy, didn't help.

Didn't apply clean to 21-pre6 (still latest I see on kernel.org), but here's
the section that seemed right.

        /*
         * Schedule Next Poll
         * ------------------
         */
        if (!sleep_time) {
                if (timer_pending(&(tz->timer)))
                        del_timer(&(tz->timer));
        } else {
                if (timer_pending(&(tz->timer)))
                        mod_timer(&(tz->timer),jiffies + (HZ * sleep_time) /
1000);
                else {
                        tz->timer.data = (unsigned long)tz;
                        tz->timer.function = acpi_thermal_run;
                        tz->timer.expires = jiffies + (HZ * sleep_time) / 1000;
                        add_timer(&(tz->timer));

Also, I think this is new with the line replaced..  Not sure exactly what's
causing it, but when I restart the cpuspeed daemon:

Starting cpuspeed: Error: Not an integer:
/proc/acpi/thermal_zone/TZS1/temperature

# cat /proc/acpi/thermal_zone/TZS1/temperature
temperature:             41 C

Looks normal to me?

Thanks!

-- 
Walter Francis

khayts.us
theblackmoor.net
unlimitedphoto.com


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: PROBLEM:  ACPI Thermal Zone for CPU0 does not update after    hibernation
  2007-04-10  1:47   ` Walter Francis
@ 2007-04-10  1:57     ` Andrew Morton
  2007-04-10  2:18       ` Walter Francis
  0 siblings, 1 reply; 4+ messages in thread
From: Andrew Morton @ 2007-04-10  1:57 UTC (permalink / raw)
  To: wally; +Cc: linux-kernel, Jung-Ik Lee, linux-acpi

On Mon, 9 Apr 2007 21:47:38 -0400 (EDT) "Walter Francis" <wally@theblackmoor.net> wrote:

> > On Fri, 6 Apr 2007 16:13:55 -0400 (EDT)
> > "Walter Francis" <wally@theblackmoor.net> wrote:
> 
> >> After hibernating, the CPU0 thermal zone never updates.  It will stay at 59C
> >> forever for example.
> 
> > Yeah, John spotted a bug in there the other day.
> >
> > Does this fix it?
> >
> > --- a/drivers/acpi/thermal.c~acpi-thermal-fix-mod_timer-interval
> > +++ a/drivers/acpi/thermal.c
> > @@ -758,7 +758,8 @@ static void acpi_thermal_check(void *dat
> >  			del_timer(&(tz->timer));
> >  	} else {
> >  		if (timer_pending(&(tz->timer)))
> > -			mod_timer(&(tz->timer), (HZ * sleep_time) / 1000);
> > +			mod_timer(&(tz->timer),
> > +					jiffies + (HZ * sleep_time) / 1000);
> >  		else {
> >  			tz->timer.data = (unsigned long)tz;
> >  			tz->timer.function = acpi_thermal_run;
> 
> No joy, didn't help.
>
> Didn't apply clean to 21-pre6 (still latest I see on kernel.org), but here's
> the section that seemed right.
> 
>         /*
>          * Schedule Next Poll
>          * ------------------
>          */
>         if (!sleep_time) {
>                 if (timer_pending(&(tz->timer)))
>                         del_timer(&(tz->timer));
>         } else {
>                 if (timer_pending(&(tz->timer)))
>                         mod_timer(&(tz->timer),jiffies + (HZ * sleep_time) /
> 1000);
>                 else {
>                         tz->timer.data = (unsigned long)tz;
>                         tz->timer.function = acpi_thermal_run;
>                         tz->timer.expires = jiffies + (HZ * sleep_time) / 1000;
>                         add_timer(&(tz->timer));

Yes, the above looks like the correct change.

> Also, I think this is new with the line replaced..  Not sure exactly what's
> causing it, but when I restart the cpuspeed daemon:
> 
> Starting cpuspeed: Error: Not an integer:
> /proc/acpi/thermal_zone/TZS1/temperature

Strange.  Maybe a timing thing.

> # cat /proc/acpi/thermal_zone/TZS1/temperature
> temperature:             41 C
> 
> Looks normal to me?

Yes it does.  What happens of you stop and restart the daemon a second
time?

fwiw, /proc/acpi/thermal_zone/ATF0/temperature seems to do the right thing
here.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: PROBLEM:  ACPI Thermal Zone for CPU0 does not update after      hibernation
  2007-04-10  1:57     ` Andrew Morton
@ 2007-04-10  2:18       ` Walter Francis
  0 siblings, 0 replies; 4+ messages in thread
From: Walter Francis @ 2007-04-10  2:18 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel, Jung-Ik Lee, linux-acpi

> On Mon, 9 Apr 2007 21:47:38 -0400 (EDT) "Walter Francis"
> <wally@theblackmoor.net> wrote:
>
>> > On Fri, 6 Apr 2007 16:13:55 -0400 (EDT)
>> > "Walter Francis" <wally@theblackmoor.net> wrote:
>>
>> >> After hibernating, the CPU0 thermal zone never updates.  It will stay at
>> 59C
>> >> forever for example.

> Yes, the above looks like the correct change.

> Strange.  Maybe a timing thing.

> Yes it does.  What happens of you stop and restart the daemon a second
> time?

Same thing, although I reverted the change and it still happens, so I must
have overlooked it before.  Which is odd, because it's right at the end of my
suspend script.  Looked to see if the cpuspeed daemon has updated recently and
it hasn't.  Strange. :)

> fwiw, /proc/acpi/thermal_zone/ATF0/temperature seems to do the right thing
> here.

SMP?  Not sure if it's directly tied to SMP, my other laptop I never could get
to behave when suspending.

If there's any more info I can provide or patches to try, let me know.

-- 
Walter Francis

khayts.us
theblackmoor.net
unlimitedphoto.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-04-10  2:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <11584.192.146.101.26.1175890435.squirrel@panacea.theblackmoor.net>
2007-04-10  0:47 ` PROBLEM: ACPI Thermal Zone for CPU0 does not update after hibernation Andrew Morton
2007-04-10  1:47   ` Walter Francis
2007-04-10  1:57     ` Andrew Morton
2007-04-10  2:18       ` Walter Francis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox