Hi,

I encounter a problem with active cooling in acpitz.

>From the hardware point of vue, during booting (-current, amd64, dmesg
below), the fan switch ON, but never go back OFF (so lot of permanent
noise).

As novice with acpi, I don't understand all the terms, sorry. But I have
been able to trace the events, and it seems that the problem occurs when
ACPITZ_TRIPS is notified (acpitz_notify 0x81), and the fan was ON.

For active cooling, the fan is switched ON when need and if
sc->sc_ac_stat[i] <= 0 ; and switched OFF when sc->sc_ac_stat[i] > 0.

It seems to me (but I may be wrong) that sc_ac_stat is used to keep a
state (UNK/OFF/ON) of fan status, and don't set fan ON (or OFF) if
already in this state.

But, when a notification 0x81 occurs, acpitz_init is called with
ACPITZ_TRIPS, which force sc->sc_ac_stat[i] = -1. And with
sc_ac_stat[i]=-1 the fan could switch ON (<=0) ; but couldn't switch OFF
(>0).


For trace that, I used the following diff (provided to understand trace
in dmesg after):

 - printf when acpitz_init is called with ACPITZ_TRIPS
 - printf when acpitz_setfan is called
 - printf during active cooling


Index: acpitz.c
===================================================================
RCS file: /cvs/src/sys/dev/acpi/acpitz.c,v
retrieving revision 1.47
diff -u -p -r1.47 acpitz.c
--- acpitz.c    12 Jul 2014 02:44:49 -0000      1.47
+++ acpitz.c    12 Jul 2014 14:12:31 -0000
@@ -136,6 +136,7 @@ acpitz_init(struct acpitz_softc *sc, int
 
        /* Read trip points */
        if (flag & ACPITZ_TRIPS) {
+               printf("%s: acpitz_init: ACPITZ_TRIPS\n", DEVNAME(sc));
                sc->sc_psv = acpitz_getreading(sc, "_PSV");
                for (i = 0; i < ACPITZ_MAX_AC; i++) {
                        snprintf(name, sizeof(name), "_AC%d", i);
@@ -275,7 +276,7 @@ acpitz_setfan(struct acpitz_softc *sc, i
        int64_t                 sta;
        struct acpi_devlist    *dl;
 
-       dnprintf(20, "%s: acpitz_setfan(%d, %s)\n", DEVNAME(sc), i, method);
+       printf("%s: acpitz_setfan(%d, %s)\n", DEVNAME(sc), i, method);
 
        x = 0;
        snprintf(name, sizeof(name), "_AL%d", i);
@@ -419,10 +420,16 @@ acpitz_refresh(void *arg)
        /* active cooling */
        for (i = 0; i < ACPITZ_MAX_AC; i++) {
                if (sc->sc_ac[i] != -1 && sc->sc_ac[i] <= sc->sc_tmp) {
+                       printf("%s: active cooling: ac <= tmp: 
sc_ac_stat[%d]=%d (ON if <=0)\n", 
+                                       DEVNAME(sc),
+                                       i, sc->sc_ac_stat[i]);
                        /* turn on fan i */
                        if (sc->sc_ac_stat[i] <= 0)
                                acpitz_setfan(sc, i, "_ON_");
                } else if (sc->sc_ac[i] != -1) {
+                       printf("%s: active cooling: ac > tmp: sc_ac_stat[%d]=%d 
(OFF if >0)\n",
+                                       DEVNAME(sc),
+                                       i, sc->sc_ac_stat[i]);
                        /* turn off fan i */
                        if (sc->sc_ac_stat[i] > 0)
                                acpitz_setfan(sc, i, "_OFF");




The dmesg is the following:

OpenBSD 5.5-current (GENERIC.MP) #18: Sat Jul 12 16:00:52 CEST 2014
    semarie@clyde:/home/semarie/tmp/openbsd/builds/obj/GENERIC.MP
real mem = 2122121216 (2023MB)
avail mem = 2056912896 (1961MB)
mpath0 at root
scsibus0 at mpath0: 256 targets
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 2.4 @ 0xf398f (23 entries)
bios0: vendor Hewlett-Packard version "68YCU Ver. F.0B" date 09/05/2007
bios0: Hewlett-Packard HP Compaq nc6400 (EH522AV)
acpi0 at bios0: rev 2
acpi0: sleep states S0 S3 S4 S5
acpi0: tables DSDT FACP SLIC HPET APIC MCFG TCPA SSDT SSDT SSDT SSDT SSDT
acpi0: wakeup devices C098(S5) C0F7(S3) C0F8(S3) C0F9(S3) C0FA(S3) C101(S0) 
C229(S0) C111(S5) C234(S5) C117(S5) C235(S5)
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpihpet0 at acpi0: 14318179 Hz
acpimadt0 at acpi0 addr 0xfee00000: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: Intel(R) Core(TM)2 CPU T5500 @ 1.66GHz, 1662.78 MHz
cpu0: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,NXE,LONG,LAHF,PERF
cpu0: 2MB 64b/line 8-way L2 cache
cpu0: smt 0, core 0, package 0
mtrr: Pentium Pro MTRR support, 8 var ranges, 88 fixed ranges
cpu0: apic clock running at 166MHz
cpu0: mwait min=64, max=64, C-substates=0.2.2.2.2, IBE
cpu1 at mainbus0: apid 1 (application processor)
cpu1: Intel(R) Core(TM)2 CPU T5500 @ 1.66GHz, 1662.50 MHz
cpu1: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,NXE,LONG,LAHF,PERF
cpu1: 2MB 64b/line 8-way L2 cache
cpu1: smt 0, core 1, package 0
ioapic0 at mainbus0: apid 1 pa 0xfec00000, version 20, 24 pins
ioapic0: misconfigured as apic 0, remapped to apid 1
acpimcfg0 at acpi0 addr 0xf8000000, bus 0-63
acpiprt0 at acpi0: bus 2 (C098)
acpiprt1 at acpi0: bus 8 (C101)
acpiprt2 at acpi0: bus 16 (C111)
acpiprt3 at acpi0: bus 0 (C002)
acpiec0 at acpi0
acpicpu0 at acpi0: C2, C1, PSS
acpicpu1 at acpi0: C2, C1, PSS
acpipwrres0 at acpi0: C1E7, resource for C1E2
acpipwrres1 at acpi0: C1EF, resource for C1E8
acpipwrres2 at acpi0: C1F6, resource for C1F0
acpipwrres3 at acpi0: C220, resource for C21E
acpipwrres4 at acpi0: C228, resource for C11A
acpipwrres5 at acpi0: C32D, resource for C331
acpipwrres6 at acpi0: C32E, resource for C332
acpipwrres7 at acpi0: C32F, resource for C333
acpipwrres8 at acpi0: C330, resource for C334
acpitz0 at acpi0: critical temperature is 256 degC
acpitz0: acpitz_init: ACPITZ_TRIPS
acpitz1 at acpi0: critical temperature is 105 degC
acpitz1: acpitz_init: ACPITZ_TRIPS
acpitz2 at acpi0: critical temperature is 105 degC
acpitz2: acpitz_init: ACPITZ_TRIPS
acpitz3 at acpi0: critical temperature is 105 degC
acpitz3: acpitz_init: ACPITZ_TRIPS
acpitz4 at acpi0: critical temperature is 110 degC
acpitz4: acpitz_init: ACPITZ_TRIPS
acpibat0 at acpi0: C1B4 model "Primary" serial 03899 2007/05/17 type LIon oem 
"Hewlett-Packard"
acpibat1 at acpi0: C1B3 not present
acpiac0 at acpi0: AC unit online
acpibtn0 at acpi0: C249
acpibtn1 at acpi0: C241
acpivideo0 at acpi0: C085
cpu0: Enhanced SpeedStep 1662 MHz: speeds: 1667, 1333, 1000 MHz
pci0 at mainbus0 bus 0
pchb0 at pci0 dev 0 function 0 "Intel 82945GM Host" rev 0x03
vga1 at pci0 dev 2 function 0 "Intel 82945GM Video" rev 0x03
intagp0 at vga1
agp0 at intagp0: aperture at 0xe0000000, size 0x10000000
inteldrm0 at vga1
drm0 at inteldrm0
inteldrm0: 1280x800
wsdisplay0 at vga1 mux 1: console (std, vt100 emulation)
wsdisplay0: screen 1-5 added (std, vt100 emulation)
"Intel 82945GM Video" rev 0x03 at pci0 dev 2 function 1 not configured
azalia0 at pci0 dev 27 function 0 "Intel 82801GB HD Audio" rev 0x01: msi
azalia0: codecs: Analog Devices AD1981HD, AT&T/Lucent/0x3026, using Analog 
Devices AD1981HD
audio0 at azalia0
ppb0 at pci0 dev 28 function 0 "Intel 82801GB PCIE" rev 0x01: msi
pci1 at ppb0 bus 8
bge0 at pci1 dev 0 function 0 "Broadcom BCM5753M" rev 0x21, BCM5750 C1 
(0x4201): msi, address 00:1b:38:33:97:b0
brgphy0 at bge0 phy 1: BCM5750 10/100/1000baseT PHY, rev. 0
ppb1 at pci0 dev 28 function 1 "Intel 82801GB PCIE" rev 0x01: msi
pci2 at ppb1 bus 16
bwi0 at pci2 dev 0 function 0 "Broadcom BCM4312" rev 0x01: apic 1 int 17, 
address 00:1a:73:6c:90:d3
uhci0 at pci0 dev 29 function 0 "Intel 82801GB USB" rev 0x01: apic 1 int 20
uhci1 at pci0 dev 29 function 1 "Intel 82801GB USB" rev 0x01: apic 1 int 22
uhci2 at pci0 dev 29 function 2 "Intel 82801GB USB" rev 0x01: apic 1 int 18
uhci3 at pci0 dev 29 function 3 "Intel 82801GB USB" rev 0x01: apic 1 int 19
ehci0 at pci0 dev 29 function 7 "Intel 82801GB USB" rev 0x01: apic 1 int 20
usb0 at ehci0: USB revision 2.0
uhub0 at usb0 "Intel EHCI root hub" rev 2.00/1.00 addr 1
ppb2 at pci0 dev 30 function 0 "Intel 82801BAM Hub-to-PCI" rev 0xe1
pci3 at ppb2 bus 2
cbb0 at pci3 dev 6 function 0 "TI PCIXX12 CardBus" rev 0x00: apic 1 int 18
"TI PCIXX12 Multimedia Card Reader" rev 0x00 at pci3 dev 6 function 2 not 
configured
sdhc0 at pci3 dev 6 function 3 "TI PCIXX12 SD" rev 0x00: apic 1 int 22
sdmmc0 at sdhc0
"TI PCIXX12 Smart Card" rev 0x00 at pci3 dev 6 function 4 not configured
cardslot0 at cbb0 slot 0 flags 0
cardbus0 at cardslot0: bus 3 device 0 cacheline 0x10, lattimer 0x20
pcmcia0 at cardslot0
pcib0 at pci0 dev 31 function 0 "Intel 82801GBM LPC" rev 0x01
pciide0 at pci0 dev 31 function 1 "Intel 82801GB IDE" rev 0x01: DMA, channel 0 
configured to compatibility, channel 1 configured to compatibility
atapiscsi0 at pciide0 channel 0 drive 0
scsibus1 at atapiscsi0: 2 targets
cd0 at scsibus1 targ 0 lun 0: <HL-DT-ST, DVDRAM GSA-U10N, HP06> ATAPI 5/cdrom 
removable
cd0(pciide0:0:0): using PIO mode 4, DMA mode 2
pciide0: channel 1 ignored (disabled)
ahci0 at pci0 dev 31 function 2 "Intel 82801GBM AHCI" rev 0x01: msi, AHCI 1.1
scsibus2 at ahci0: 32 targets
sd0 at scsibus2 targ 0 lun 0: <ATA, Hitachi HTS54161, SB4O> SCSI3 0/direct 
fixed t10.ATA_Hitachi_HTS541616J9SA00_SB2481SJEKVZ1E
sd0: 152627MB, 512 bytes/sector, 312581808 sectors
usb1 at uhci0: USB revision 1.0
uhub1 at usb1 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb2 at uhci1: USB revision 1.0
uhub2 at usb2 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb3 at uhci2: USB revision 1.0
uhub3 at usb3 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb4 at uhci3: USB revision 1.0
uhub4 at usb4 "Intel UHCI root hub" rev 1.00/1.00 addr 1
isa0 at pcib0
isadma0 at isa0
com2 at isa0 port 0x3e8/8 irq 5: ns16550a, 16 byte fifo
pckbc0 at isa0 port 0x60/5
pckbd0 at pckbc0 (kbd slot)
pckbc0: using irq 1 for kbd slot
wskbd0 at pckbd0: console keyboard, using wsdisplay0
pms0 at pckbc0 (aux slot)
pckbc0: using irq 12 for aux slot
wsmouse0 at pms0 mux 0
wsmouse1 at pms0 mux 0
pms0: Synaptics touchpad, firmware 6.2
pcppi0 at isa0 port 0x61
spkr0 at pcppi0
acpitz0: acpitz_init: ACPITZ_TRIPS
acpitz0: active cooling: ac > tmp: sc_ac_stat[0]=-1 (OFF if >0)
acpitz0: active cooling: ac > tmp: sc_ac_stat[1]=-1 (OFF if >0)
acpitz0: active cooling: ac > tmp: sc_ac_stat[2]=-1 (OFF if >0)
acpitz0: active cooling: ac <= tmp: sc_ac_stat[3]=-1 (ON if <=0)
acpitz0: acpitz_setfan(3, _ON_)
acpitz1: acpitz_init: ACPITZ_TRIPS
acpitz2: acpitz_init: ACPITZ_TRIPS
acpitz3: acpitz_init: ACPITZ_TRIPS
ugen0 at uhub2 port 1 "AuthenTec Fingerprint Sensor" rev 1.10/6.23 addr 2
vscsi0 at root
scsibus3 at vscsi0: 256 targets
softraid0 at root
scsibus4 at softraid0: 256 targets
root on sd0a (3ed108d2b4f1280b.a) swap on sd0b dump on sd0b
acpitz0: active cooling: ac > tmp: sc_ac_stat[0]=-1 (OFF if >0)
acpitz0: active cooling: ac > tmp: sc_ac_stat[1]=-1 (OFF if >0)
acpitz0: active cooling: ac > tmp: sc_ac_stat[2]=-1 (OFF if >0)
acpitz0: active cooling: ac <= tmp: sc_ac_stat[3]=1 (ON if <=0)
sd1 at scsibus4 targ 1 lun 0: <OPENBSD, SR CRYPTO, 005> SCSI2 0/direct fixed
sd1: 51200MB, 512 bytes/sector, 104857680 sectors
acpitz0: active cooling: ac > tmp: sc_ac_stat[0]=-1 (OFF if >0)
acpitz0: active cooling: ac > tmp: sc_ac_stat[1]=-1 (OFF if >0)
acpitz0: active cooling: ac > tmp: sc_ac_stat[2]=-1 (OFF if >0)
acpitz0: active cooling: ac <= tmp: sc_ac_stat[3]=1 (ON if <=0)
acpitz0: active cooling: ac > tmp: sc_ac_stat[0]=-1 (OFF if >0)
acpitz0: active cooling: ac > tmp: sc_ac_stat[1]=-1 (OFF if >0)
acpitz0: active cooling: ac > tmp: sc_ac_stat[2]=-1 (OFF if >0)
acpitz0: active cooling: ac <= tmp: sc_ac_stat[3]=1 (ON if <=0)
acpitz0: active cooling: ac > tmp: sc_ac_stat[0]=-1 (OFF if >0)
acpitz0: active cooling: ac > tmp: sc_ac_stat[1]=-1 (OFF if >0)
acpitz0: active cooling: ac > tmp: sc_ac_stat[2]=-1 (OFF if >0)
acpitz0: active cooling: ac <= tmp: sc_ac_stat[3]=1 (ON if <=0)
acpitz0: active cooling: ac > tmp: sc_ac_stat[0]=-1 (OFF if >0)
acpitz0: active cooling: ac > tmp: sc_ac_stat[1]=-1 (OFF if >0)
acpitz0: active cooling: ac > tmp: sc_ac_stat[2]=-1 (OFF if >0)
acpitz0: active cooling: ac <= tmp: sc_ac_stat[3]=1 (ON if <=0)
acpitz0: acpitz_init: ACPITZ_TRIPS
acpitz0: active cooling: ac > tmp: sc_ac_stat[0]=-1 (OFF if >0)
acpitz0: active cooling: ac > tmp: sc_ac_stat[1]=-1 (OFF if >0)
acpitz0: active cooling: ac > tmp: sc_ac_stat[2]=-1 (OFF if >0)
acpitz0: active cooling: ac > tmp: sc_ac_stat[3]=-1 (OFF if >0)
acpitz0: active cooling: ac > tmp: sc_ac_stat[0]=-1 (OFF if >0)
acpitz0: active cooling: ac > tmp: sc_ac_stat[1]=-1 (OFF if >0)
acpitz0: active cooling: ac > tmp: sc_ac_stat[2]=-1 (OFF if >0)
acpitz0: active cooling: ac > tmp: sc_ac_stat[3]=-1 (OFF if >0)
acpitz0: active cooling: ac > tmp: sc_ac_stat[0]=-1 (OFF if >0)
acpitz0: active cooling: ac > tmp: sc_ac_stat[1]=-1 (OFF if >0)
acpitz0: active cooling: ac > tmp: sc_ac_stat[2]=-1 (OFF if >0)
acpitz0: active cooling: ac > tmp: sc_ac_stat[3]=-1 (OFF if >0)
acpitz0: active cooling: ac > tmp: sc_ac_stat[0]=-1 (OFF if >0)
acpitz0: active cooling: ac > tmp: sc_ac_stat[1]=-1 (OFF if >0)
acpitz0: active cooling: ac > tmp: sc_ac_stat[2]=-1 (OFF if >0)
acpitz0: active cooling: ac > tmp: sc_ac_stat[3]=-1 (OFF if >0)
acpitz0: active cooling: ac > tmp: sc_ac_stat[0]=-1 (OFF if >0)
acpitz0: active cooling: ac > tmp: sc_ac_stat[1]=-1 (OFF if >0)
acpitz0: active cooling: ac > tmp: sc_ac_stat[2]=-1 (OFF if >0)
acpitz0: active cooling: ac > tmp: sc_ac_stat[3]=-1 (OFF if >0)
...


Thanks.
-- 
Sébastien Marie

Reply via email to