Bug 2588
Summary: | Can set all but active[2] temperature via trip_points | ||
---|---|---|---|
Product: | ACPI | Reporter: | Hugo Haas (hugo) |
Component: | Config-Other | Assignee: | acpi_config-other |
Status: | CLOSED CODE_FIX | ||
Severity: | normal | CC: | acpi-bugzilla, stefan.seyfried, trenn |
Priority: | P2 | ||
Hardware: | i386 | ||
OS: | Linux | ||
Kernel Version: | 2.6.5 + swsusp2 | Subsystem: | |
Regression: | --- | Bisected commit-id: | |
Attachments: |
dmesg
dmidecode output acpidmp output Patch making acpi_thermal_write_trip_points() consider all trip points Patch making acpi_thermal_write_trip_points() consider all trip points v2 another (shorter) patch for the same problem corrected patch #2730, against vanilla 2.6.7 |
Description
Hugo Haas
2004-04-24 23:21:02 UTC
Created attachment 2693 [details]
dmesg
Created attachment 2694 [details]
dmidecode output
Created attachment 2695 [details]
acpidmp output
acpi_thermal_write_trip_points() in thermal.c only reads up to active1. It doesn't take into account other values. Created attachment 2697 [details]
Patch making acpi_thermal_write_trip_points() consider all trip points
The current acpi_thermal_write_trip_points() only considers 5 values: critical,
hot, passive, active0 and active1.
This patch makes it consider all the relevant values.
One can now do, with 1 active point:
echo -n "100:90:80:70" > trip_points
With 3, you can do:
echo -n "100:90:80:70:60:50" > trip_points
Etc, trip_points being under /proc/acpi/thermal_zone/*.
With this code, the limitation on the number of trip points is set by
ACPI_THERMAL_MAX_ACTIVE, which is AFAICT a global limitation.
I have tested it and it works for me.
Regards,
Hugo
Created attachment 2698 [details]
Patch making acpi_thermal_write_trip_points() consider all trip points v2
The patch I previously sent had some memory management issues. This version
should be OK. For a description, please refer to #2697.
Created attachment 2730 [details]
another (shorter) patch for the same problem
Note that with my patch, you need to supply at least 5 values, to be compatible
to the old behaviour, but lowering the limit is trivial.
Yes, my patch is slightly more complex but doesn't have any hard-coded limits. The drawback with the simpler patch is that, would somebody have 50 trip points (would that ever happen?), we would need to change the code again. Another one is, as you mention, that one needs to echo a lot of trailing :0's. But it does fix my problem (well, at least for a while as mentioned in #2592), so either is fine by me. the limit of 10 trip points is in the ACPI spec, you don't need to echo additional ":0", since sscanf just returns the number of matches found. Thus the for "(i = 0; i < num - 3; i++)" loop. I explicitly tested this case (my machine has four trip points and i set only 2 or three). The lower limit of 5 arguments (2 trip points) is just for backwards compatibility with the old behaviour where you always needed to provide exactly 5 values and can easily be changed to allow setting of a single trip point). So let the gurus decide on what they like better, i believe both are working well. ;-) Stefan, Could you update and clear your patch? So, Len will apply it. thanks, Created attachment 3284 [details]
corrected patch #2730, against vanilla 2.6.7
the change to patch #2730 is
- int active[9];
+ int active[ACPI_THERMAL_MAX_ACTIVE];
it is obviously correct since i use active[0]...active[9],
ACPI_THERMAL_MAX_ACTIVE is defined as 10.
shipped in 2.6.9 closing *** Bug 2074 has been marked as a duplicate of this bug. *** |