Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 18 Apr 2011 08:43:56 -0700
From:      mdf@FreeBSD.org
To:        John Baldwin <jhb@freebsd.org>
Cc:        freebsd-current@freebsd.org, Nick Ulen <uncle@wolfman.devio.us>
Subject:   Re: `hw.acpi.thermal.tz0.temperature' disappeared
Message-ID:  <BANLkTim=M=JeOn8iSgfnhT-Q0dX=QfYLuw@mail.gmail.com>
In-Reply-To: <201104180805.40743.jhb@freebsd.org>
References:  <20110416155122.GA29309@wolfman.devio.us> <201104180805.40743.jhb@freebsd.org>

index | next in thread | previous in thread | raw e-mail

[-- Attachment #1 --]
On Mon, Apr 18, 2011 at 5:05 AM, John Baldwin <jhb@freebsd.org> wrote:
> On Saturday, April 16, 2011 11:51:22 am Nick Ulen wrote:
>> FreeBSD was successfully upgraded.
>>
>> uname -v
>> FreeBSD 9.0-CURRENT #0: Mon Apr 11 18:14:36 MSD 2011
>> root@test:/usr/obj/usr/src/sys/GENERIC
>>
>> Everything seems to be working well except
>> `hw.acpi.thermal.tz0.temperature' disappeared from the list of available
>> sysctl variables.
>>
>> sysctl hw.acpi.thermal.
>>
>> hw.acpi.thermal.min_runtime: 0
>> hw.acpi.thermal.polling_rate: 10
>> hw.acpi.thermal.user_override: 0
>> hw.acpi.thermal.tz0.active: -1
>> hw.acpi.thermal.tz0.passive_cooling: 0
>> hw.acpi.thermal.tz0.thermal_flags: 0
>> hw.acpi.thermal.tz0._PSV: -1
>> hw.acpi.thermal.tz0._HOT: -1
>> hw.acpi.thermal.tz0._CRT: 90.0C
>> hw.acpi.thermal.tz0._TC1: -1
>> hw.acpi.thermal.tz0._TC2: -1
>> hw.acpi.thermal.tz0._TSP: -1
>>
>> output from:
>>  sysctl -a |grep acpi
>> is here: https://privatepaste.com/ca08d4658b
>
> I suspect it is still there, but sysctl doesn't know how to display it
> anymore.  This is probably due to the changes with formatting of sysctl
> information.  mdf@ is probably responsible in that case.
>
>    SYSCTL_ADD_OPAQUE(&sc->tz_sysctl_ctx, SYSCTL_CHILDREN(sc->tz_sysctl_tree),
>                      OID_AUTO, "temperature", CTLFLAG_RD, &sc->tz_temperature,
>                      sizeof(sc->tz_temperature), "IK",
>                      "current thermal zone temperature");


I don't seem to have a hw.acpi.thermal sysctl node on my box.  Can
someone please try this patch?

Thanks,
matthew

[-- Attachment #2 --]
diff --git a/sys/dev/acpica/acpi_thermal.c b/sys/dev/acpica/acpi_thermal.c
index 515a742..b64d8df 100644
--- a/sys/dev/acpica/acpi_thermal.c
+++ b/sys/dev/acpica/acpi_thermal.c
@@ -257,10 +257,10 @@ acpi_tz_attach(device_t dev)
     sc->tz_sysctl_tree = SYSCTL_ADD_NODE(&sc->tz_sysctl_ctx,
 					 SYSCTL_CHILDREN(acpi_tz_sysctl_tree),
 					 OID_AUTO, oidname, CTLFLAG_RD, 0, "");
-    SYSCTL_ADD_OPAQUE(&sc->tz_sysctl_ctx, SYSCTL_CHILDREN(sc->tz_sysctl_tree),
-		      OID_AUTO, "temperature", CTLFLAG_RD, &sc->tz_temperature,
-		      sizeof(sc->tz_temperature), "IK",
-		      "current thermal zone temperature");
+    SYSCTL_ADD_PROC(&sc->tz_sysctl_ctx, SYSCTL_CHILDREN(sc->tz_sysctl_tree),
+		    OID_AUTO, "temperature", CTLTYPE_INT | CTLFLAG_RD,
+		    &sc->tz_temperature, 0, sysctl_handle_int,
+		    "IK", "current thermal zone temperature");
     SYSCTL_ADD_PROC(&sc->tz_sysctl_ctx, SYSCTL_CHILDREN(sc->tz_sysctl_tree),
 		    OID_AUTO, "active", CTLTYPE_INT | CTLFLAG_RW,
 		    sc, 0, acpi_tz_active_sysctl, "I", "cooling is active");
@@ -286,9 +286,9 @@ acpi_tz_attach(device_t dev)
 		    sc, offsetof(struct acpi_tz_softc, tz_zone.crt),
 		    acpi_tz_temp_sysctl, "IK",
 		    "critical temp setpoint (shutdown now)");
-    SYSCTL_ADD_OPAQUE(&sc->tz_sysctl_ctx, SYSCTL_CHILDREN(sc->tz_sysctl_tree),
-		      OID_AUTO, "_ACx", CTLFLAG_RD, &sc->tz_zone.ac,
-		      sizeof(sc->tz_zone.ac), "IK", "");
+    SYSCTL_ADD_PROC(&sc->tz_sysctl_ctx, SYSCTL_CHILDREN(sc->tz_sysctl_tree),
+		    OID_AUTO, "_ACx", CTLTYPE_INT | CTLFLAG_RD,
+		    &sc->tz_zone.ac, 0, sysctl_handle_int, "IK", "");
     SYSCTL_ADD_PROC(&sc->tz_sysctl_ctx, SYSCTL_CHILDREN(sc->tz_sysctl_tree),
 		    OID_AUTO, "_TC1", CTLTYPE_INT | CTLFLAG_RW,
 		    sc, offsetof(struct acpi_tz_softc, tz_zone.tc1),
help

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?BANLkTim=M=JeOn8iSgfnhT-Q0dX=QfYLuw>