All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Machek <pavel-+ZI9xUNit7I@public.gmane.org>
To: "Grover, Andrew" <andrew.grover-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Cc: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: Re: FW: ACPI too sensitive about critical temperature
Date: Mon, 19 Jan 2004 23:02:52 +0100	[thread overview]
Message-ID: <20040119220251.GD380@elf.ucw.cz> (raw)
In-Reply-To: <F760B14C9561B941B89469F59BA3A84702C9321E-sBd4vmA9Se4Lll3ZsUKC9FDQ4js95KgL@public.gmane.org>

Hi!

> I didn't want to bug the whole lkml with this, so I'm sending this to 
> you guys who wrote "drivers/acpi/thermal.c". I hope that's okay...
> 
> A friend of mine has a mainboard (I can find out the specific type if 
> you want to know) which reports inaccurately high temperature "peaks" 
> from time to time.
> Looking at /proc/acpi/thermal_zone/THR1/temperature every second might 
> look something like this: 45, 43, 47, 42, 90, 43, 41, 45

Try this one.

								Pavel

--- clean/drivers/acpi/thermal.c	2003-07-27 22:31:09.000000000 +0200
+++ linux/drivers/acpi/thermal.c	2004-01-13 22:33:49.000000000 +0100
@@ -223,8 +223,11 @@
 	tz->last_temperature = tz->temperature;
 
 	status = acpi_evaluate_integer(tz->handle, "_TMP", NULL, &tz->temperature);
-	if (ACPI_FAILURE(status))
+	if (ACPI_FAILURE(status)) {
+		if (tz->temperature != tz->last_temperature)
+			printk(KERN_ERR "temperature damaged while processing\n");
 		return -ENODEV;
+	}
 
 	ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Temperature is %lu dK\n", tz->temperature));
 
@@ -457,7 +460,17 @@
 		return_VALUE(-EINVAL);
 
 	if (tz->temperature >= tz->trips.critical.temperature) {
+		long old_temperature = tz->temperature;
 		ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Critical trip point\n"));
+
+		result = acpi_thermal_get_temperature(tz);
+		if (!result) {
+			if (tz->temperature < (tz->trips.critical.temperature - 100)) {
+				printk(KERN_ALERT "ACPI changed its mind about temperature, was %ld C, now %ld C", 
+				       KELVIN_TO_CELSIUS(old_temperature), KELVIN_TO_CELSIUS(tz->temperature));
+				return_VALUE(0);
+			}
+		}
 		tz->trips.critical.flags.enabled = 1;
 	}
 	else if (tz->trips.critical.flags.enabled)
@@ -467,8 +480,8 @@
 	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);
 
 	return_VALUE(0);

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


-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn

      parent reply	other threads:[~2004-01-19 22:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-19  8:50 FW: ACPI too sensitive about critical temperature Grover, Andrew
     [not found] ` <F760B14C9561B941B89469F59BA3A84702C9321E-sBd4vmA9Se4Lll3ZsUKC9FDQ4js95KgL@public.gmane.org>
2004-01-19 22:02   ` Pavel Machek [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040119220251.GD380@elf.ucw.cz \
    --to=pavel-+zi9xunit7i@public.gmane.org \
    --cc=acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    --cc=andrew.grover-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.