Skip to contentSkip to conversation

Tell user when ACPI is killing machine

PATCH Pavel Machek 3 participants 5 messages Nov 28, 2003

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi!

On critical overheat (or perceived critical overheat -- acpi bioses on some notebooks apparently report bogus values from time to time), kernel itself calls /sbin/halt *without telling anything*. User can not see anything, his machine just shuts down cleanly. Bad.

We should at least tell the user what is going on...

Pavel

drivers/acpi/thermal.c +1 -0
@@ -467,6 +474,7 @@
 	if (result)
 		return_VALUE(result);
 
+	printk(KERN_EMERG "Critical temperature reached (%d C), shutting down.\n", tz->temperature);
 	acpi_bus_generate_event(device, ACPI_THERMAL_NOTIFY_CRITICAL, tz->trips.critical.flags.enabled);
 
 	acpi_thermal_call_usermode(ACPI_THERMAL_PATH_POWEROFF);
Signature · 2 lines
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]
#1 lore raw

Hi!

Quoted 6 lines

On critical overheat (or perceived critical overheat -- acpi bioses on some notebooks apparently report bogus values from time to time), kernel itself calls /sbin/halt *without telling anything*. User can not see anything, his machine just shuts down cleanly. Bad.

We should at least tell the user what is going on...

Okay, I had two bugs in single line of code (%ld and KELVIN_TO_CELSIUS). Sorry about that, here's better version.

Pavel

drivers/acpi/thermal.c +1 -0
@@ -467,6 +474,7 @@
 	if (result)
 		return_VALUE(result);
 
+	printk(KERN_EMERG "Critical temperature reached (%ld C), shutting down.\n", KELVIN_TO_CELSIUS(tz->temperature));
 	acpi_bus_generate_event(device, ACPI_THERMAL_NOTIFY_CRITICAL, tz->trips.critical.flags.enabled);
 
 	acpi_thermal_call_usermode(ACPI_THERMAL_PATH_POWEROFF);
Signature · 2 lines
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]
#2 lore raw
In reply to Pavel Machek

drivers/acpi/thermal.c line 477

Quoted 1 line · Pavel Machek
drivers/acpi/thermal.c +1 -0
+	printk(KERN_EMERG "Critical temperature reached (%d C), shutting down.\n", tz->temperature);

Maybe there should be a KELVIN_TO_CELSIUS conversion for tz->temperature?

Regards,
Frederik Deweerdt
[email protected]

#3 lore raw
In reply to Pavel Machek
Quoted 4 lines · Pavel Machek

On critical overheat (or perceived critical overheat -- acpi bioses on some notebooks apparently report bogus values from time to time), kernel itself calls /sbin/halt *without telling anything*. User can not see anything, his machine just shuts down cleanly. Bad.

Sorry if this is a bit OT, but why doesn't ACPI scale the CPU frequency back instead of shutting down? This is what APM does on my laptop (presumably in the BIOS) but when I enable ACPI the machine shuts down whenever I do something CPU intensive (yes; it's a poorly designed laptop). I have cpufreq support (cpufreq: P4/Xeon(TM) CPU On-Demand Clock Modulation available). Has this kind of thing been added since I last tried it, or do I actually have to actively set up cpufreq in user space to get thermally-induced clock modulation? Or is not even possible with the current state of things?

#4 lore raw

Hi!

Quoted 6 lines
Quoted 4 lines

On critical overheat (or perceived critical overheat -- acpi bioses on some notebooks apparently report bogus values from time to time), kernel itself calls /sbin/halt *without telling anything*. User can not see anything, his machine just shuts down cleanly. Bad.

Sorry if this is a bit OT, but why doesn't ACPI scale the CPU

Yep it is OT.

Quoted 5 lines

frequency back instead of shutting down? This is what APM does on my laptop (presumably in the BIOS) but when I enable ACPI the machine shuts down whenever I do something CPU intensive (yes; it's a poorly designed laptop). I have cpufreq support (cpufreq: P4/Xeon(TM) CPU On-Demand Clock Modulation available). Has this kind of thing been

It should try scaling first (and it works for me (tm)), but when temperature reaches "critical" limit it is assumed that everything failed and shutdown is only option. (On hp omnibook even in slowest possible mode, if you play .mpg video it overheats.)

Quoted 3 lines

added since I last tried it, or do I actually have to actively set up cpufreq in user space to get thermally-induced clock modulation? Or is not even possible with the current state of things?

cpufreq is not connected to acpi thermal subsystem. Dominik has some patches to change that, IIRC.
Pavel

Signature · 2 lines
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]