summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authornjl <njl@FreeBSD.org>2004-02-02 18:03:35 +0000
committernjl <njl@FreeBSD.org>2004-02-02 18:03:35 +0000
commit38fffd503dc200f712495c0486d2328fd60d987f (patch)
treee493f18cbf53d9a5b0abc092d3e10df7e57cc67d /sys/dev
parent0ed839756aa4f1e7d4dfb90095766d7dd097a0cc (diff)
downloadFreeBSD-src-38fffd503dc200f712495c0486d2328fd60d987f.zip
FreeBSD-src-38fffd503dc200f712495c0486d2328fd60d987f.tar.gz
If the temperature is at _HOT or _CRT for 3 sequential readings, shutdown
the system. Also, decrease the poll interval to 10 seconds from 30 seconds. This is needed because some systems will report an invalid high temperature for one poll cycle. It is suspected this is due to the embedded controller timing out. A typical value is 138C for one cycle on a system that is otherwise 65C. This prevents the system from prematurely shutting down after one invalid reading. It will still shut down after 30 seconds of high temperature, which is the same as previous default behavior. Tested by: Scott Lambert <lambert AT lambertfam.org>
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/acpica/acpi_thermal.c35
1 files changed, 21 insertions, 14 deletions
diff --git a/sys/dev/acpica/acpi_thermal.c b/sys/dev/acpica/acpi_thermal.c
index 7efec65..32fb551 100644
--- a/sys/dev/acpica/acpi_thermal.c
+++ b/sys/dev/acpica/acpi_thermal.c
@@ -53,8 +53,11 @@ ACPI_MODULE_NAME("THERMAL")
#define TZ_NOTIFY_LEVELS 0x81
#define TZ_NOTIFY_DEVICES 0x82
-/* Check for temperature changes every 30 seconds by default */
-#define TZ_POLLRATE 30
+/* Check for temperature changes every 10 seconds by default */
+#define TZ_POLLRATE 10
+
+/* Make sure the reported temperature is valid for this number of polls. */
+#define TZ_VALIDCHECKS 3
/* ACPI spec defines this */
#define TZ_NUMLEVELS 10
@@ -71,7 +74,6 @@ struct acpi_tz_zone {
int tzp;
};
-
struct acpi_tz_softc {
device_t tz_dev;
ACPI_HANDLE tz_handle; /*Thermal zone handle*/
@@ -95,6 +97,7 @@ struct acpi_tz_softc {
struct acpi_tz_zone tz_zone; /*Thermal zone parameters*/
int tz_tmp_updating;
+ int tz_validchecks;
};
static int acpi_tz_probe(device_t dev);
@@ -472,18 +475,22 @@ acpi_tz_monitor(void *Context)
/* XXX (de)activate any passive cooling that may be required. */
/*
- * If we have just become _HOT or _CRT, warn the user.
- *
- * We should actually shut down at this point, but it's not clear
- * that some systems don't actually map _CRT to the same value as _AC0.
+ * If the temperature is at _HOT or _CRT, increment our event count.
+ * If it has occurred enough times, shutdown the system. This is
+ * needed because some systems will report an invalid high temperature
+ * for one poll cycle. It is suspected this is due to the embedded
+ * controller timing out. A typical value is 138C for one cycle on
+ * a system that is otherwise 65C.
*/
- if ((newflags & (TZ_THFLAG_HOT | TZ_THFLAG_CRT)) != 0 &&
- (sc->tz_thflags & (TZ_THFLAG_HOT | TZ_THFLAG_CRT)) == 0) {
-
- device_printf(sc->tz_dev,
- "WARNING - current temperature (%d.%dC) exceeds system limits\n",
- TZ_KELVTOC(sc->tz_temperature));
- shutdown_nice(RB_POWEROFF);
+ if ((newflags & (TZ_THFLAG_HOT | TZ_THFLAG_CRT)) != 0) {
+ if (++sc->tz_validchecks == TZ_VALIDCHECKS) {
+ device_printf(sc->tz_dev,
+ "WARNING - current temperature (%d.%dC) exceeds safe limits\n",
+ TZ_KELVTOC(sc->tz_temperature));
+ shutdown_nice(RB_POWEROFF);
+ }
+ } else {
+ sc->tz_validchecks = 0;
}
sc->tz_thflags = newflags;
OpenPOWER on IntegriCloud