aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/thermal.c
diff options
context:
space:
mode:
authorLen Brown <len.brown@intel.com>2007-04-30 23:27:43 -0400
committerLen Brown <len.brown@intel.com>2007-04-30 23:27:43 -0400
commiteaca2d3f6c4de9d4274a4e2be54c9693e76b0303 (patch)
tree9e62d1c292e0e4ffce1aea88a37f4aec5fb0281a /drivers/acpi/thermal.c
parent11ccc0f249cb01a129f54760b8ff087f242935d4 (diff)
ACPI: delete un-reliable concept of cooling mode
The scheme where the thermal driver displayed the cooling mode /proc/acpi/thermal_zone/*/cooling_mode was flawed in two ways. First, the success of _SCP doesn't actually mean that the BIOS moved any trip points. On many BIOS, _SCP is present, but does nothing. So displaying what _SCP executed actually was wrong more times than it was right. Second, examining the relative position of the trip points when the thermal_zone is added is insufficient -- as the BIOS reserves the right to change the trip points at run-time. The only reliable way for the user to determine if the thermal zone is in active, passive, or critical mode is to examine the relative position of the trip points. The user can do this without the kernel doing it for them by looking in /proc/acpi/thermal_zone/*/trip_points New contents for /proc/acpi/thermal_zone/*/cooling_mode: If _SCP available: "0 - Active; 1 - Passive\n" If _SCP unavailable: "<setting not supported>\n" Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/thermal.c')
-rw-r--r--drivers/acpi/thermal.c39
1 files changed, 2 insertions, 37 deletions
diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c
index 73b6fe7093e9..1ada017d01ef 100644
--- a/drivers/acpi/thermal.c
+++ b/drivers/acpi/thermal.c
@@ -59,8 +59,6 @@
59#define ACPI_THERMAL_NOTIFY_CRITICAL 0xF0 59#define ACPI_THERMAL_NOTIFY_CRITICAL 0xF0
60#define ACPI_THERMAL_NOTIFY_HOT 0xF1 60#define ACPI_THERMAL_NOTIFY_HOT 0xF1
61#define ACPI_THERMAL_MODE_ACTIVE 0x00 61#define ACPI_THERMAL_MODE_ACTIVE 0x00
62#define ACPI_THERMAL_MODE_PASSIVE 0x01
63#define ACPI_THERMAL_MODE_CRITICAL 0xff
64#define ACPI_THERMAL_PATH_POWEROFF "/sbin/poweroff" 62#define ACPI_THERMAL_PATH_POWEROFF "/sbin/poweroff"
65 63
66#define ACPI_THERMAL_MAX_ACTIVE 10 64#define ACPI_THERMAL_MAX_ACTIVE 10
@@ -164,7 +162,6 @@ struct acpi_thermal {
164 unsigned long temperature; 162 unsigned long temperature;
165 unsigned long last_temperature; 163 unsigned long last_temperature;
166 unsigned long polling_frequency; 164 unsigned long polling_frequency;
167 u8 cooling_mode;
168 volatile u8 zombie; 165 volatile u8 zombie;
169 struct acpi_thermal_flags flags; 166 struct acpi_thermal_flags flags;
170 struct acpi_thermal_state state; 167 struct acpi_thermal_state state;
@@ -293,11 +290,6 @@ static int acpi_thermal_set_cooling_mode(struct acpi_thermal *tz, int mode)
293 if (ACPI_FAILURE(status)) 290 if (ACPI_FAILURE(status))
294 return -ENODEV; 291 return -ENODEV;
295 292
296 tz->cooling_mode = mode;
297
298 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Cooling mode [%s]\n",
299 mode ? "passive" : "active"));
300
301 return 0; 293 return 0;
302} 294}
303 295
@@ -893,15 +885,10 @@ static int acpi_thermal_cooling_seq_show(struct seq_file *seq, void *offset)
893 if (!tz) 885 if (!tz)
894 goto end; 886 goto end;
895 887
896 if (!tz->flags.cooling_mode) { 888 if (!tz->flags.cooling_mode)
897 seq_puts(seq, "<setting not supported>\n"); 889 seq_puts(seq, "<setting not supported>\n");
898 }
899
900 if (tz->cooling_mode == ACPI_THERMAL_MODE_CRITICAL)
901 seq_printf(seq, "cooling mode: critical\n");
902 else 890 else
903 seq_printf(seq, "cooling mode: %s\n", 891 seq_puts(seq, "0 - Active; 1 - Passive\n");
904 tz->cooling_mode ? "passive" : "active");
905 892
906 end: 893 end:
907 return 0; 894 return 0;
@@ -1158,28 +1145,6 @@ static int acpi_thermal_get_info(struct acpi_thermal *tz)
1158 result = acpi_thermal_set_cooling_mode(tz, ACPI_THERMAL_MODE_ACTIVE); 1145 result = acpi_thermal_set_cooling_mode(tz, ACPI_THERMAL_MODE_ACTIVE);
1159 if (!result) 1146 if (!result)
1160 tz->flags.cooling_mode = 1; 1147 tz->flags.cooling_mode = 1;
1161 else {
1162 /* Oh,we have not _SCP method.
1163 Generally show cooling_mode by _ACx, _PSV,spec 12.2 */
1164 tz->flags.cooling_mode = 0;
1165 if (tz->trips.active[0].flags.valid
1166 && tz->trips.passive.flags.valid) {
1167 if (tz->trips.passive.temperature >
1168 tz->trips.active[0].temperature)
1169 tz->cooling_mode = ACPI_THERMAL_MODE_ACTIVE;
1170 else
1171 tz->cooling_mode = ACPI_THERMAL_MODE_PASSIVE;
1172 } else if (!tz->trips.active[0].flags.valid
1173 && tz->trips.passive.flags.valid) {
1174 tz->cooling_mode = ACPI_THERMAL_MODE_PASSIVE;
1175 } else if (tz->trips.active[0].flags.valid
1176 && !tz->trips.passive.flags.valid) {
1177 tz->cooling_mode = ACPI_THERMAL_MODE_ACTIVE;
1178 } else {
1179 /* _ACx and _PSV are optional, but _CRT is required */
1180 tz->cooling_mode = ACPI_THERMAL_MODE_CRITICAL;
1181 }
1182 }
1183 1148
1184 /* Get default polling frequency [_TZP] (optional) */ 1149 /* Get default polling frequency [_TZP] (optional) */
1185 if (tzp) 1150 if (tzp)