summaryrefslogtreecommitdiffstats
path: root/sys/dev/acpica
diff options
context:
space:
mode:
authorume <ume@FreeBSD.org>2008-02-16 07:15:34 +0000
committerume <ume@FreeBSD.org>2008-02-16 07:15:34 +0000
commit09ebea38d071d5bdf9d0ee78cecac1783667e0a2 (patch)
tree9d5cf0cbfdf74700f39ca3e0275e45d57f70ccf4 /sys/dev/acpica
parent8455c7d94a11143c69ce68c00ea1a2d3d30201f4 (diff)
downloadFreeBSD-src-09ebea38d071d5bdf9d0ee78cecac1783667e0a2.zip
FreeBSD-src-09ebea38d071d5bdf9d0ee78cecac1783667e0a2.tar.gz
Create a thread to handle passive cooling for 1st zone which has _PSV,
_TSP, _TC1 and _TC2. Contirmed by: "Alexandre \"Sunny\" Kovalenko" <alex.kovalenko_at_verizon.net> Reviewed by: njl MFC after: 1 week
Diffstat (limited to 'sys/dev/acpica')
-rw-r--r--sys/dev/acpica/acpi_thermal.c39
1 files changed, 20 insertions, 19 deletions
diff --git a/sys/dev/acpica/acpi_thermal.c b/sys/dev/acpica/acpi_thermal.c
index cd5f34b..4f90142 100644
--- a/sys/dev/acpica/acpi_thermal.c
+++ b/sys/dev/acpica/acpi_thermal.c
@@ -173,6 +173,8 @@ static int acpi_tz_override;
static struct proc *acpi_tz_proc;
ACPI_LOCK_DECL(thermal, "ACPI thermal zone");
+static int acpi_tz_cooling_unit = -1;
+
static int
acpi_tz_probe(device_t dev)
{
@@ -206,17 +208,7 @@ acpi_tz_attach(device_t dev)
sc->tz_cooling_proc_running = FALSE;
sc->tz_cooling_active = FALSE;
sc->tz_cooling_updated = FALSE;
-
- /*
- * Always attempt to enable passive cooling for tz0. Users can enable
- * it for other zones manually for now.
- *
- * XXX We need to test if multiple zones conflict with each other
- * since cpufreq currently sets all CPUs to the given frequency whereas
- * it's possible for different thermal zones to specify independent
- * settings for multiple CPUs.
- */
- sc->tz_cooling_enabled = (device_get_unit(dev) == 0);
+ sc->tz_cooling_enabled = FALSE;
/*
* Parse the current state of the thermal zone and build control
@@ -325,16 +317,25 @@ acpi_tz_attach(device_t dev)
}
}
- /* Create a thread to handle passive cooling for each zone if enabled. */
+ /*
+ * Create a thread to handle passive cooling for 1st zone which
+ * has _PSV, _TSP, _TC1 and _TC2. Users can enable it for other
+ * zones manually for now.
+ *
+ * XXX We enable only one zone to avoid multiple zones conflict
+ * with each other since cpufreq currently sets all CPUs to the
+ * given frequency whereas it's possible for different thermal
+ * zones to specify independent settings for multiple CPUs.
+ */
+ if (acpi_tz_cooling_unit < 0 && acpi_tz_cooling_is_available(sc))
+ sc->tz_cooling_enabled = TRUE;
if (sc->tz_cooling_enabled) {
- if (acpi_tz_cooling_is_available(sc)) {
- error = acpi_tz_cooling_thread_start(sc);
- if (error != 0) {
- sc->tz_cooling_enabled = FALSE;
- goto out;
- }
- } else
+ error = acpi_tz_cooling_thread_start(sc);
+ if (error != 0) {
sc->tz_cooling_enabled = FALSE;
+ goto out;
+ }
+ acpi_tz_cooling_unit = device_get_unit(dev);
}
/*
OpenPOWER on IntegriCloud