diff options
author | njl <njl@FreeBSD.org> | 2007-03-05 21:39:53 +0000 |
---|---|---|
committer | njl <njl@FreeBSD.org> | 2007-03-05 21:39:53 +0000 |
commit | e346acc30df9e6e8a4d6f4d0a6db074437f3df28 (patch) | |
tree | c04f9d523aa2ac4224af1e7763b37020f1ecf27f /sys/dev/acpica | |
parent | 729ccfcf36f4e84dea82a3a3900f430615123f39 (diff) | |
download | FreeBSD-src-e346acc30df9e6e8a4d6f4d0a6db074437f3df28.zip FreeBSD-src-e346acc30df9e6e8a4d6f4d0a6db074437f3df28.tar.gz |
Check the _TMP value for sanity also. On some systems (HP NX laptops), the
EC occasionally times out and provides bogus values (3000C). This change
prevents those systems from prematurely shutting down while we work on the
underlying problem. Also, bump the sanity value to 0...200C from 0...150C.
Diffstat (limited to 'sys/dev/acpica')
-rw-r--r-- | sys/dev/acpica/acpi_thermal.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/sys/dev/acpica/acpi_thermal.c b/sys/dev/acpica/acpi_thermal.c index eeb2234..5f50468 100644 --- a/sys/dev/acpica/acpi_thermal.c +++ b/sys/dev/acpica/acpi_thermal.c @@ -434,10 +434,12 @@ acpi_tz_get_temperature(struct acpi_tz_softc *sc) { int temp; ACPI_STATUS status; + static char *tmp_name = "_TMP"; ACPI_FUNCTION_NAME ("acpi_tz_get_temperature"); - status = acpi_GetInteger(sc->tz_handle, "_TMP", &temp); + /* Evaluate the thermal zone's _TMP method. */ + status = acpi_GetInteger(sc->tz_handle, tmp_name, &temp); if (ACPI_FAILURE(status)) { ACPI_VPRINT(sc->tz_dev, acpi_device_get_parent_softc(sc->tz_dev), "error fetching current temperature -- %s\n", @@ -445,6 +447,11 @@ acpi_tz_get_temperature(struct acpi_tz_softc *sc) return (FALSE); } + /* Check it for validity. */ + acpi_tz_sanity(sc, &temp, tmp_name); + if (temp == -1) + return (FALSE); + ACPI_DEBUG_PRINT((ACPI_DB_VALUES, "got %d.%dC\n", TZ_KELVTOC(temp))); sc->tz_temperature = temp; return (TRUE); @@ -646,12 +653,12 @@ acpi_tz_getparam(struct acpi_tz_softc *sc, char *node, int *data) /* * Sanity-check a temperature value. Assume that setpoints - * should be between 0C and 150C. + * should be between 0C and 200C. */ static void acpi_tz_sanity(struct acpi_tz_softc *sc, int *val, char *what) { - if (*val != -1 && (*val < TZ_ZEROC || *val > TZ_ZEROC + 1500)) { + if (*val != -1 && (*val < TZ_ZEROC || *val > TZ_ZEROC + 2000)) { device_printf(sc->tz_dev, "%s value is absurd, ignored (%d.%dC)\n", what, TZ_KELVTOC(*val)); *val = -1; |