2003-11-28 14:55:38

by Pavel Machek

[permalink] [raw]
Subject: Tell user when ACPI is killing machine

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

--- clean/drivers/acpi/thermal.c 2003-07-27 22:31:09.000000000 +0200
+++ linux/drivers/acpi/thermal.c 2003-11-25 22:27:11.000000000 +0100
@@ -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);

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


2003-11-28 16:52:11

by Pavel Machek

[permalink] [raw]
Subject: Re: Tell user when ACPI is killing machine

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...

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

Pavel

--- clean/drivers/acpi/thermal.c 2003-07-27 22:31:09.000000000 +0200
+++ linux/drivers/acpi/thermal.c 2003-11-28 17:42:17.000000000 +0100
@@ -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);


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

2003-11-28 17:10:06

by Frederik Deweerdt

[permalink] [raw]
Subject: Re: Tell user when ACPI is killing machine

On Fri, 2003-11-28 at 15:55, Pavel Machek wrote:
> + 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]

2003-11-28 22:02:06

by Aaron Lehmann

[permalink] [raw]
Subject: Re: Tell user when ACPI is killing machine

On Fri, Nov 28, 2003 at 03:55:58PM +0100, Pavel Machek wrote:
> 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?

2003-11-28 23:42:21

by Pavel Machek

[permalink] [raw]
Subject: Re: Tell user when ACPI is killing machine

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.
>
> Sorry if this is a bit OT, but why doesn't ACPI scale the CPU

Yep it is OT.

> 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.)

> 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

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