Bug 8495 - Cannot change thermal trip points
Summary: Cannot change thermal trip points
Status: REJECTED INVALID
Alias: None
Product: ACPI
Classification: Unclassified
Component: Power-Thermal (show other bugs)
Hardware: i386 Linux
: P2 normal
Assignee: Len Brown
URL:
Keywords:
: 8496 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-05-17 13:28 UTC by Maciej Rutecki
Modified: 2007-05-20 14:27 UTC (History)
1 user (show)

See Also:
Kernel Version: 2.6.22-rc1-mm1
Subsystem:
Regression: ---
Bisected commit-id:


Attachments

Description Maciej Rutecki 2007-05-17 13:28:02 UTC
In 2.6.20.9 I can change trippoints (example):
 
 echo "105:100:100:78:70:40:30" > /proc/acpi/thermal_zone/TZ0/trip_points
 echo 10  > /proc/acpi/thermal_zone/TZ0/polling_frequency
 
 Then I got:
 cat /proc/acpi/thermal_zone/TZ0/*
 <setting not supported>
 cooling mode:   active
 polling frequency:       10 seconds
 state:                   active[2]
 temperature:             45 C
 critical (S5):           105 C
 active[0]:               78 C: devices=0xdf415a40
 active[1]:               70 C: devices=0xdf4159dc
 active[2]:               40 C: devices=0xdf41598c
 active[3]:               30 C: devices=0xdf41593c
 
 cat /proc/acpi/fan/*/*
 status:                  off
 status:                  off
 status:                  on
 status:                  on
 
 And fan turns on.
 
 In 2.6.22-rc1-mm1:
 echo "105:100:100:78:70:40:30" > /proc/acpi/thermal_zone/TZ0/trip_points
 bash: echo: write error: B&#313;&#130;
Comment 1 Maciej Rutecki 2007-05-17 13:55:51 UTC

*** This bug has been marked as a duplicate of 8496 ***
Comment 2 Dave Jones 2007-05-17 14:01:31 UTC
*** Bug 8496 has been marked as a duplicate of this bug. ***
Comment 3 Len Brown 2007-05-17 15:09:37 UTC
original:
 active[2]:               60 C: devices=0xc182798c
 active[3]:               50 C: devices=0xc182793c

modified:
 active[2]:               40 C: devices=0xdf41598c
 active[3]:               30 C: devices=0xdf41593c

So at 45C, you want your fan to be running at 2nd speed rather
than off as the OEM designed the platform?

You enable polling mode as a workaround for the fact
that the first trip point is not actually going to fire until 50*C?

What happens if you purposely heat up the system
past the actual 50*C trip point?
Do you find that your manual trip-points
are still intact, or does the contents of trip_points change?

Can you turn on the fan this way?
echo 0 > /proc/acpi/fan/.../state
where "..." corresponds to the file for the lowest speed,
and when that is on, you can then try the file corresponding
to the 2nd speed.
Comment 4 Len Brown 2007-05-17 15:11:23 UTC
*** Bug 8496 has been marked as a duplicate of this bug. ***
Comment 5 Maciej Rutecki 2007-05-18 01:17:52 UTC
"So at 45C, you want your fan to be running at 2nd speed rather
than off as the OEM designed the platform?"

Yes, it is a example. In my hp nx6310 only I want change critical trip point,
but my friend need change first trippoint from 30*C to (for example) 50, because
fan turns on too early (hp nc6220). Unfortunately she doesn't want test latest
-mm kernel, but propably she has similar problem.

In this case I want change turn on fan to 2nd speed at 45*C. Default is 50 for
1st speed and 60*C for 2nd speed.

When I don't change trippoints (defaults), fan works (I don't need use polling
mode).

When I heat the system (eg. command: "openssl speed") and don't change
trippoints fan turns on at 50*C (in 2.6.20.9 and 2.6.22-rc1-mm1) it works fine.

2.6.20.9: I can change trippoints (as in description) and fan turns on earlier.
In 2.6.22-rc1-mm1 I cannot.

echo 0 > /proc/acpi/fan/xxx/state
"0" turns on
"3" turns off

Works

xxx:
C30C (100% speed of fan), C30D (3rd speed - 75%), C30E (2nd speed - 60%), C30F
(1st speed - 40%).

In my case this problem isn't big, in all probability CPU shouldn't rise over
100*C. But many hp notebooks (for example my friend) will have problem with
read-only trip points.

PS Sorry for my English and duplicate bug (first time I use bugzilla).
Comment 6 Maciej Rutecki 2007-05-18 01:35:21 UTC
"You enable polling mode as a workaround for the fact
that the first trip point is not actually going to fire until 50*C?"

"polling mode" it means "colling_policy" or "colling_mode" file?

ls /proc/acpi/thermal_zone/TZ0/
cooling_mode  polling_frequency  state  temperature  trip_points

cat  /proc/acpi/thermal_zone/TZ0/cooling_mode
<setting not supported>
cooling mode:   active
Comment 7 Len Brown 2007-05-18 21:32:30 UTC
> echo 0 > /proc/acpi/fan/xxx/state
> "0" turns on
> "3" turns off
>
> Works

Thanks for confirming that you can control your fam-speed at will
without over-riding the trip points.

When you or your friend use 2.6.21 and manually over-ridin the trip points.
What happens when the temperature changes to cross one
of the system-provided trip points.
Does the trip-point file stay in its over-ride form,
or does the system change it out from under you?



Comment 8 Maciej Rutecki 2007-05-19 10:37:04 UTC
kernel 2.6.21, config, dmesg:
http://www.unixy.pl/maciek/download/kernel/2.6.21/


daemon acpid disabled[1], defaults trip points

-----
scenario: CPU: idle

rutek:/home/maciek/kernel.org/2.6.21# cat //proc/acpi/thermal_zone/TZ0/*
<setting not supported>
cooling mode:   active
<polling disabled>
state:                   ok
temperature:             45 C
critical (S5):           256 C
active[0]:               78 C: devices=0xdf790a40
active[1]:               70 C: devices=0xdf7909dc
active[2]:               60 C: devices=0xdf79098c
active[3]:               50 C: devices=0xdf79093c

rutek:/home/maciek/kernel.org/2.6.21# cat //proc/acpi/fan/*/state
status:                  off
status:                  off
status:                  off
status:                  off

-----
scenario: run command: "openssl speed"

rutek:/home/maciek/kernel.org/2.6.21# cat //proc/acpi/thermal_zone/TZ0/*
<setting not supported>
cooling mode:   active
<polling disabled>
state:                   active[3]
temperature:             50 C
critical (S5):           256 C
active[0]:               78 C: devices=0xdf790a40
active[1]:               70 C: devices=0xdf7909dc
active[2]:               60 C: devices=0xdf79098c
active[3]:               45 C: devices=0xdf79093c

rutek:/home/maciek/kernel.org/2.6.21# cat //proc/acpi/fan/*/state
status:                  off
status:                  off
status:                  off
status:                  on

-> NOTE: active[3] change from 50*C to 45*C

rutek:/home/maciek# cat /proc/acpi/event
thermal_zone TZ0 00000081 00000000
thermal_zone TZ0 00000081 00000000

-----
scenario: run command "openssl speed" longer

rutek:/home/maciek/kernel.org/2.6.21# cat //proc/acpi/thermal_zone/TZ0/*
<setting not supported>
cooling mode:   active
<polling disabled>
state:                   active[2]
temperature:             60 C
critical (S5):           256 C
active[0]:               78 C: devices=0xdf790a40
active[1]:               70 C: devices=0xdf7909dc
active[2]:               55 C: devices=0xdf79098c
active[3]:               45 C: devices=0xdf79093c

rutek:/home/maciek/kernel.org/2.6.21# cat //proc/acpi/fan/*/state
status:                  off
status:                  off
status:                  on
status:                  on

->Note: active[3] change from 50 to 45
active[2] from 60 to 55

rutek:/home/maciek# cat /proc/acpi/event
thermal_zone TZ0 00000081 00000000
thermal_zone TZ0 00000081 00000000
thermal_zone TZ0 00000081 00000000

-----
Scenario: return to CPU idle:
rutek:/home/maciek/kernel.org/2.6.21# cat //proc/acpi/thermal_zone/TZ0/*
<setting not supported>
cooling mode:   active
<polling disabled>
state:                   ok
temperature:             45 C
critical (S5):           256 C
active[0]:               78 C: devices=0xdf790a40
active[1]:               70 C: devices=0xdf7909dc
active[2]:               60 C: devices=0xdf79098c
active[3]:               50 C: devices=0xdf79093c

rutek:/home/maciek/kernel.org/2.6.21# cat //proc/acpi/fan/*/state
status:                  off
status:                  off
status:                  off
status:                  off

===========================
Comments:
[1] When acpid is enabled and I change trip points, any events from
/proc/acpi/events change trip points to defaults (depends on actual temperature
- like above). So I must add this files:

file: /etc/acpi/events/thermal_zone
#called when acpid receives thermal_zone event
event=thermal_zone
action=/etc/acpi/thermal_zone.sh

-----
file: /etc/acpi/thermal_zone.sh
#!/bin/sh
echo "105:100:100:78:70:60:50" > /proc/acpi/thermal_zone/TZ0/trip_points
echo 10  > /proc/acpi/thermal_zone/TZ0/polling_frequency

Scenario: run acpid and "openssl speed":

rutek:/home/maciek/kernel.org/2.6.21# cat //proc/acpi/thermal_zone/TZ0/*
<setting not supported>
cooling mode:   active
polling frequency:       10 seconds
state:                   active[3]
temperature:             50 C
critical (S5):           105 C
active[0]:               78 C: devices=0xdf790a40
active[1]:               70 C: devices=0xdf7909dc
active[2]:               60 C: devices=0xdf79098c
active[3]:               50 C: devices=0xdf79093c

rutek:/home/maciek/kernel.org/2.6.21# cat //proc/acpi/fan/*/state
status:                  off
status:                  off
status:                  off
status:                  on
Comment 9 Maciej Rutecki 2007-05-19 12:07:15 UTC
"Comments:
[1] When acpid is enabled and I change trip points, any events from
/proc/acpi/events "

Should be:
"any _thermal_ events"
Comment 10 Maciej Rutecki 2007-05-20 03:14:59 UTC
Update:
I was wrong, that not acpid change trippoints, but system did it:

acpid stop, change trip points like below:

rutek:/home/maciek# cat /proc/acpi/thermal_zone/TZ0/*
<setting not supported>
cooling mode:   active
polling frequency:       10 seconds
state:                   ok
temperature:             45 C
critical (S5):           105 C
active[0]:               78 C: devices=0xdf415a40
active[1]:               70 C: devices=0xdf4159dc
active[2]:               60 C: devices=0xdf41598c
active[3]:               50 C: devices=0xdf41593c

When run openssl speed:

rutek:/home/maciek# cat /proc/acpi/thermal_zone/TZ0/*
<setting not supported>
cooling mode:   active
polling frequency:       10 seconds
state:                   active[3]
temperature:             50 C
critical (S5):           256 C
active[0]:               78 C: devices=0xdf415a40
active[1]:               70 C: devices=0xdf4159dc
active[2]:               60 C: devices=0xdf41598c
active[3]:               45 C: devices=0xdf41593c

critical (S5) change from user 105*c to system default 256*C
Comment 11 Len Brown 2007-05-20 14:27:31 UTC
Thanks for testing.

The results confirm that the ACPI BIOS
will change the trip-points to implement
hysteresis when it crosses the ACPI trip points.

Yes, this will wipe out any modifications that the user
has made to the OS copy of the trip points.

Further, as the user no longer sees the ACPI trip-points,
the user may not know when this is going to happen,
and would thus have to continuously over-ride the OS trip points
on every temperature change or trip-point event
to make the over-ride effective.

Finally, if the user does not enabling polling, the
modified OS trip points have no effect at all except
to deceive the user into thinking that they've implemented
a change in policy - since the BIOS continues to work with
the real ACPI trip points.

For these reasons, the ability for the user to over-ride
the OS copy of the read-only ACPI trip-points was a bug,
and removing that ability was a bug-fix.

You have confirmed that you can over-ride the state of
the fan until the next ACPI trip point is reached --
and that is what you should do if you disagree with
the policy implemented by the system vendor.
If too loud, turn off/down the fan.
If too warm, turn on/up the fan.

Also, if the vendor (had) implemented _SCP (cooling_mode)
that would give you a choice in cooling policies.

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