Bug 4930 - temperatures not updated until 'acpi' client is run
Summary: temperatures not updated until 'acpi' client is run
Status: REJECTED INVALID
Alias: None
Product: ACPI
Classification: Unclassified
Component: Power-Thermal (show other bugs)
Hardware: i386 Linux
: P2 normal
Assignee: Konstantin Karasyov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-22 15:40 UTC by Sanjoy Mahajan
Modified: 2005-11-28 00:12 UTC (History)
1 user (show)

See Also:
Kernel Version: 2.6.13-rc3
Subsystem:
Regression: ---
Bisected commit-id:


Attachments
Add UPDT function to all thermal zone _TMP methods (872 bytes, patch)
2005-07-23 04:41 UTC, Jamie Lentin
Details | Diff
hysteresis for active cooling (1.05 KB, patch)
2005-07-23 12:13 UTC, Sanjoy Mahajan
Details | Diff
acpidmp output (206.32 KB, application/octet-stream)
2005-11-18 11:27 UTC, Sanjoy Mahajan
Details

Description Sanjoy Mahajan 2005-07-22 15:40:23 UTC
Distribution: Debian testing ('etch')
Hardware Environment: TP 600X Pentium III 650 MHz, 576 MB
Software Environment: Fixed DSDT attached in Bug #4926

Problem Description: The temperature in thermal zone 2 (disk?) isn't updated
automatically even though polling_frequency is set to 10.  It is updated when I
run the command-line 'acpi' program, though I often have to run it twice.

Steps to reproduce:
I set the trip-point for THM2 to 48 C and the polling frequency to 10:

echo 120:0:40:48:0 > THM2/trip_points
echo 10 > THM2/polling_frequency

Then I ran a process (reindexing the huge wwwoffle cache) that ran the disk a
lot and drove the temperature over 48 C.  The fan was on (with a bit of prodding
from acpi -t).  Eventually the process finished and the fan stayed on.  A few
minutes after it was done I could feel the air coming out was reasonably cool. 
So I checked the temperature by catting the state files:

/proc/acpi/thermal_zone/THM2# cat temperature trip_points polling_frequency 
temperature:             49 C
critical (S5):           120 C
active[0]:               48 C: devices=0xc1575108
polling frequency:       10 seconds

It was plenty of time for the 10-second polling to have updated the temperature.
 But I didn't believe the 49 C so I ran acpi -t twice right away:

sanjoy:/proc/acpi/thermal_zone/THM2# acpi -t
     Battery 1: charged, 99%
     Battery 2: charged, 99%
     Thermal 1: ok, 43.0 degrees C
     Thermal 2: active[0], 49.0 degrees C
     Thermal 3: ok, 35.0 degrees C
     Thermal 4: ok, 38.0 degrees C
sanjoy:/proc/acpi/thermal_zone/THM2# acpi -t
     Battery 1: charged, 99%
     Battery 2: charged, 99%
     Thermal 1: ok, 43.0 degrees C
     Thermal 2: ok, 40.0 degrees C
     Thermal 3: ok, 35.0 degrees C
     Thermal 4: ok, 37.0 degrees C

And voila the second acpi produces 40 C for the temperature, which felt about
right.  And the fan stopped (right before I ran the second acpi).

This lack-of-update problem was there in 2.6.11.4 as well, and perhaps even worse. 

I'm using acpi v0.09 (Debian package), and its the stock 2.6.13-rc3.  Am happy
to try patches and/or turn on acpi debugging output.
Comment 1 Jamie Lentin 2005-07-23 04:41:33 UTC
Created attachment 5367 [details]
Add UPDT function to all thermal zone _TMP methods

This looks like a DSDT bug---your laptop is of the same basic stock as mine
(770X).  Polling THM0 for it's temperature causes the temperature variables to
update, whilst none of the others do.  For each ThermalZone(THMx) you will see
a _TMP method.	The one in THM0 calls UPDT, none of the rest do.  Apply the
attached patch to the decompiled DSDT code.

Also, you should be able to turn on polling for THM0 to fix your problem, since
this will cause the UPDT function to be run on a regular basis.
Comment 2 Sanjoy Mahajan 2005-07-23 12:13:14 UTC
Created attachment 5369 [details]
hysteresis for active cooling

Thanks very much, that was the problem.  Also, I remembered the improvement
related to the acpi client when going from 2.6.11.4 to 2.6.13-rc3: With .11,
the lcd brightness would often change wheen I ran acpi, whereas that does not
happen with .13.

Once temperature polling worked again, the fan was turning on and off quickly
as the temperature crossed the active trip point.  The patch below adds
hysteresis to the thermal kernel driver: It turns off active cooling only when
the temperature falls, say, 2 C below the trip point. Maybe the magic
difference should be 5 degrees; I'd be curious what setting suits people.

Tested and working on my TP 600X with 2.6.11.4 (but also patches cleanly
against 2.6.13-rc3).
Comment 3 Konstantin Karasyov 2005-09-07 05:38:45 UTC
Do this bug appears on Windows too?
Comment 4 Sanjoy Mahajan 2005-09-07 05:59:54 UTC
> Do this bug appears on Windows too?

I don't know -- no Windows anywhere around here.  But the DSDT
modification in Comment #1 fixed the problem.

Comment 5 Konstantin Karasyov 2005-11-17 06:05:26 UTC
The more info is needed to close this bug. Could you please attach the output 
from acpidump, available in pmtools here:
http://ftp.kernel.org/pub/linux/kernel/people/lenb/acpi/utils/

> Once temperature polling worked again, the fan was turning on and off quickly
> as the temperature crossed the active trip point.  The patch below adds
> hysteresis to the thermal kernel driver: It turns off active cooling only 
when
> the temperature falls, say, 2 C below the trip point. Maybe the magic
> difference should be 5 degrees; I'd be curious what setting suits people.

How often the fan on/off switches occurs? Wasn't it possible to reduce fan 
switching frequency by increasing polling interval?
Comment 6 Sanjoy Mahajan 2005-11-18 11:27:11 UTC
Created attachment 6613 [details]
acpidmp output
Comment 7 Sanjoy Mahajan 2005-11-18 11:31:07 UTC
I didn't think of slowing down the switching by increasing the polling interval,
but I'm pretty sure that would have worked.  What's interesting is that
hysteresis is built into the DSDT and works fine (I think 34 and 39 are the trip
points in THM2, one for going up the other for going down in temperature).  But
after changing the trip point with

  echo 120:0:40:50:0 > /proc/acpi/thermal_zone/THM2/trip_points

it uses 50 as the trip point whether going up or down (so no more hysteresis).
Comment 8 Konstantin Karasyov 2005-11-28 00:12:44 UTC
> What's interesting is that
> hysteresis is built into the DSDT and works fine (I think 34 and 39 are the 
> trip
> points in THM2, one for going up the other for going down in temperature).  
But
> after changing the trip point with
> 
>   echo 120:0:40:50:0 > /proc/acpi/thermal_zone/THM2/trip_points
> 
> it uses 50 as the trip point whether going up or down (so no more 
hysteresis).

It looks like the the trip points are somehow 'hardcoded' there, so the 
hysteresys is applied to this fixed values. Another DSDT issue ;)

> The patch below adds
> hysteresis to the thermal kernel driver: It turns off active cooling only 
when
> the temperature falls, say, 2 C below the trip point. Maybe the magic
> difference should be 5 degrees; I'd be curious what setting suits people.

It should be the feature request. Please, contact Len Brown on that.

Note You need to log in before you can comment on or make changes to this bug.