I've finally found some time to work on the fan control support for my
But I'm having problems calling to acpiec_write() from sysctl or
timeout_set(9) context. (Assertion failure in acpiec_gpehandler()).
According to dev/acpi/acpiec.c:229 this function is meant to be called
only from "acpi thread context".
Now how am I supposed to talk to the acpi controller?
One solution would be to use the aml_register_notify(..., ACPIDEV_POLL)
callback mechanism already in use by the acpithinkpad(4) driver to
somehow get into acpi thread context. The problem is that this callback
mechanism is hardcoded to 10s intervals. But I need intervals <1s to
implement a workaround described on
any help is appreciated. I'm stuck here.
this is what I've got so far:
RCS file: /cvs/src/sys/arch/i386/i386/machdep.c,v
retrieving revision 1.485
diff -u -p -r1.485 machdep.c
--- arch/i386/i386/machdep.c 2 Oct 2010 23:31:34 -0000 1.485
+++ arch/i386/i386/machdep.c 19 Dec 2010 15:11:09 -0000
@@ -243,6 +243,7 @@ void via_update_sensor(void *args);
* safepri is a safe priority for sleep to set for a spin-wait
@@ -3416,6 +3417,8 @@ cpu_sysctl(int *name, u_int namelen, voi
return (sysctl_rdint(oldp, oldlenp, newp, i386_has_xcrypt));
return (sysctl_int(oldp, oldlenp, newp, newlen, &lid_suspend));
+ case CPU_FANCONTROL:
+ return (sysctl_int(oldp, oldlenp, newp, newlen, &fan_control));
RCS file: /cvs/src/sys/arch/i386/include/cpu.h,v
retrieving revision 1.117
diff -u -p -r1.117 cpu.h
--- arch/i386/include/cpu.h 2 Oct 2010 23:13:28 -0000 1.117
You are not supposed to talk directly to the ec device.
Jordan has a diff floating around for acpi tasklets. This really should
be the way to get this done. I'll forward the diff to tech with the
caveat that it isn't finalized yet.
I would prefer for this fan stuff to be automatic instead of by hand