From 9134e725ec9f023ad3711139125dd592c8b7770a Mon Sep 17 00:00:00 2001 From: njl Date: Tue, 22 Feb 2005 00:40:13 +0000 Subject: Set the start of the cooling time later on, when we're actually performing the switch. Other interim tests (i.e., for minimum runtime) could invalidate the start time. This fixes transitions to cooler states in that now they go to the next active state (_AC0 -> _AC1) instead of going straight to off (_AC0 -> off). Submitted by: Alexandre "Sunny" Kovalenko (Alex.Kovalenko / verizon.net) --- sys/dev/acpica/acpi_thermal.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sys/dev/acpica/acpi_thermal.c') diff --git a/sys/dev/acpica/acpi_thermal.c b/sys/dev/acpica/acpi_thermal.c index f936cd9..53e791f 100644 --- a/sys/dev/acpica/acpi_thermal.c +++ b/sys/dev/acpica/acpi_thermal.c @@ -398,14 +398,13 @@ acpi_tz_monitor(void *Context) */ newactive = TZ_ACTIVE_NONE; for (i = TZ_NUMLEVELS - 1; i >= 0; i--) { - if ((sc->tz_zone.ac[i] != -1) && (temp >= sc->tz_zone.ac[i])) { + if (sc->tz_zone.ac[i] != -1 && temp >= sc->tz_zone.ac[i]) { newactive = i; if (sc->tz_active != newactive) { ACPI_VPRINT(sc->tz_dev, acpi_device_get_parent_softc(sc->tz_dev), "_AC%d: temperature %d.%d >= setpoint %d.%d\n", i, TZ_KELVTOC(temp), TZ_KELVTOC(sc->tz_zone.ac[i])); - getnanotime(&sc->tz_cooling_started); } } } @@ -455,6 +454,7 @@ acpi_tz_monitor(void *Context) acpi_tz_aclevel_string(sc->tz_active), acpi_tz_aclevel_string(newactive), TZ_KELVTOC(temp)); sc->tz_active = newactive; + getnanotime(&sc->tz_cooling_started); } /* XXX (de)activate any passive cooling that may be required. */ -- cgit v1.1