openBSD 5.2 amd64 on lenovo x201s, part 2 apm support and overheating

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

openBSD 5.2 amd64 on lenovo x201s, part 2 apm support and overheating

Andriy Samsonyuk
Hi,

is apm/apmd the only wat to change the fan speen?

The fan speen never goes above:
hw.sensors.acpithinkpad0.fan0=4527 RPM
+- few RPMs

if i set apmd -C or -A the laptop powers off after a while
without any warnings.

with apm -L or -H its running, but getting hotter.

Any suggestions/ideas?

Kind regards,

Andriy


sysctl hw.sensors

hw.sensors.cpu0.temp0=68.00 degC
hw.sensors.cpu1.temp0=68.00 degC
hw.sensors.cpu2.temp0=68.00 degC
hw.sensors.cpu3.temp0=68.00 degC
hw.sensors.acpitz0.temp0=77.00 degC (zone temperature)
hw.sensors.acpibat0.volt0=14.40 VDC (voltage)
hw.sensors.acpibat0.volt1=16.62 VDC (current voltage)
hw.sensors.acpibat0.current0=0.00 A (rate)
hw.sensors.acpibat0.amphour0=2.02 Ah (last full capacity)
hw.sensors.acpibat0.amphour1=0.10 Ah (warning capacity)
hw.sensors.acpibat0.amphour2=0.01 Ah (low capacity)
hw.sensors.acpibat0.amphour3=2.02 Ah (remaining capacity), OK
hw.sensors.acpibat0.raw0=0 (battery full), OK
hw.sensors.acpiac0.indicator0=On (power supply)
hw.sensors.acpithinkpad0.temp0=77.00 degC
hw.sensors.acpithinkpad0.temp1=77.00 degC
hw.sensors.acpithinkpad0.temp2=77.00 degC
hw.sensors.acpithinkpad0.temp3=77.00 degC
hw.sensors.acpithinkpad0.temp4=77.00 degC
hw.sensors.acpithinkpad0.temp5=77.00 degC
hw.sensors.acpithinkpad0.temp6=77.00 degC
hw.sensors.acpithinkpad0.temp7=77.00 degC
hw.sensors.acpithinkpad0.fan0=4527 RPM
hw.sensors.acpidock0.indicator0=Off (not docked)
hw.sensors.itherm0.temp0=0.00 degC (Thermometer)
hw.sensors.itherm0.temp1=74.04 degC (Core 1)
hw.sensors.itherm0.temp4=77.00 degC (CPU/GPU Max temp)
hw.sensors.itherm0.temp9=77.00 degC (GPU/Memory controller abs.)
hw.sensors.itherm0.temp10=72.00 degC (PCH abs.)
hw.sensors.itherm0.power0=6.00 W (CPU power consumption)
hw.sensors.aps0.temp0=37.00 degC
hw.sensors.aps0.temp1=37.00 degC
hw.sensors.aps0.indicator0=On (Keyboard Active)
hw.sensors.aps0.indicator1=Off (Mouse Active)
hw.sensors.aps0.indicator2=On (Lid Open)
hw.sensors.aps0.raw0=492 (X_ACCEL)
hw.sensors.aps0.raw1=475 (Y_ACCEL)
hw.sensors.aps0.raw2=492 (X_VAR)
hw.sensors.aps0.raw3=475 (Y_VAR)


OpenBSD 5.2 (GENERIC.MP) #368: Wed Aug  1 10:04:49 MDT 2012
    [hidden email]:/usr/src/sys/arch/amd64/compile/GENERIC.MP
real mem = 4078419968 (3889MB)
avail mem = 3947483136 (3764MB)
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 2.6 @ 0xe0010 (78 entries)
bios0: vendor LENOVO version "6QET64WW (1.34 )" date 02/24/2011
bios0: LENOVO 5397FEG
acpi0 at bios0: rev 2
acpi0: sleep states S0 S3 S4 S5
acpi0: tables DSDT FACP SSDT ECDT APIC MCFG HPET ASF! SLIC BOOT SSDT TCPA DMAR
SSDT SSDT SSDT
acpi0: wakeup devices LID_(S3) SLPB(S3) IGBE(S4) EXP1(S4) EXP2(S4) EXP3(S4)
EXP4(S4) EXP5(S4) EHC1(S3) EHC2(S3) HDEF(S4)
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpiec0 at acpi0
acpimadt0 at acpi0 addr 0xfee00000: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: Intel(R) Core(TM) i7 CPU L 640 @ 2.13GHz, 2128.41 MHz
cpu0:
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUS
H,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,SBF,SSE3,PCLMUL,MWAIT,DS-CPL,VMX,SMX,ES
T,TM2,SSSE3,CX16,xTPR,PDCM,SSE4.1,SSE4.2,POPCNT,AES,NXE,LONG,LAHF
cpu0: 256KB 64b/line 8-way L2 cache
cpu0: apic clock running at 132MHz
cpu1 at mainbus0: apid 1 (application processor)
cpu1: Intel(R) Core(TM) i7 CPU L 640 @ 2.13GHz, 2128.00 MHz
cpu1:
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUS
H,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,SBF,SSE3,PCLMUL,MWAIT,DS-CPL,VMX,SMX,ES
T,TM2,SSSE3,CX16,xTPR,PDCM,SSE4.1,SSE4.2,POPCNT,AES,NXE,LONG,LAHF
cpu1: 256KB 64b/line 8-way L2 cache
cpu2 at mainbus0: apid 4 (application processor)
cpu2: Intel(R) Core(TM) i7 CPU L 640 @ 2.13GHz, 2128.00 MHz
cpu2:
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUS
H,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,SBF,SSE3,PCLMUL,MWAIT,DS-CPL,VMX,SMX,ES
T,TM2,SSSE3,CX16,xTPR,PDCM,SSE4.1,SSE4.2,POPCNT,AES,NXE,LONG,LAHF
cpu2: 256KB 64b/line 8-way L2 cache
cpu3 at mainbus0: apid 5 (application processor)
cpu3: Intel(R) Core(TM) i7 CPU L 640 @ 2.13GHz, 2128.00 MHz
cpu3:
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUS
H,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,SBF,SSE3,PCLMUL,MWAIT,DS-CPL,VMX,SMX,ES
T,TM2,SSSE3,CX16,xTPR,PDCM,SSE4.1,SSE4.2,POPCNT,AES,NXE,LONG,LAHF
cpu3: 256KB 64b/line 8-way L2 cache
ioapic0 at mainbus0: apid 1 pa 0xfec00000, version 20, 24 pins
ioapic0: misconfigured as apic 2, remapped to apid 1
acpimcfg0 at acpi0 addr 0xe0000000, bus 0-255
acpihpet0 at acpi0: 14318179 Hz
acpiprt0 at acpi0: bus 0 (PCI0)
acpiprt1 at acpi0: bus -1 (PEG_)
acpiprt2 at acpi0: bus 13 (EXP1)
acpiprt3 at acpi0: bus -1 (EXP2)
acpiprt4 at acpi0: bus -1 (EXP3)
acpiprt5 at acpi0: bus -1 (EXP4)
acpiprt6 at acpi0: bus 2 (EXP5)
acpicpu0 at acpi0: C3, C1, PSS
acpicpu1 at acpi0: C3, C1, PSS
acpicpu2 at acpi0: C3, C1, PSS
acpicpu3 at acpi0: C3, C1, PSS
acpipwrres0 at acpi0: PUBS
acpitz0 at acpi0: critical temperature is 100 degC
acpibtn0 at acpi0: LID_
acpibtn1 at acpi0: SLPB
acpibat0 at acpi0: BAT0 model "42T4646" serial  1282 type LION oem "SANYO"
acpibat1 at acpi0: BAT1 not present
acpiac0 at acpi0: AC unit online
acpithinkpad0 at acpi0
acpidock0 at acpi0: GDCK not docked (0)
cpu0: Enhanced SpeedStep 2128 MHz: speeds: 2134, 2133, 1999, 1866, 1733, 1599,
1466, 1333, 1199 MHz
pci0 at mainbus0 bus 0
pchb0 at pci0 dev 0 function 0 "Intel Core Host" rev 0x02
vga1 at pci0 dev 2 function 0 "Intel HD Graphics" rev 0x02
wsdisplay0 at vga1 mux 1: console (80x25, vt100 emulation)
wsdisplay0: screen 1-5 added (80x25, vt100 emulation)
intagp0 at vga1
agp0 at intagp0: aperture at 0xd0000000, size 0x10000000
inteldrm0 at vga1: apic 1 int 16
drm0 at inteldrm0
"Intel 3400 MEI" rev 0x06 at pci0 dev 22 function 0 not configured
"Intel 3400 KT" rev 0x06 at pci0 dev 22 function 3 not configured
em0 at pci0 dev 25 function 0 "Intel 82577LM" rev 0x06: msi, address
00:26:2d:f0:f5:7e
ehci0 at pci0 dev 26 function 0 "Intel 3400 USB" rev 0x06: apic 1 int 23
usb0 at ehci0: USB revision 2.0
uhub0 at usb0 "Intel EHCI root hub" rev 2.00/1.00 addr 1
azalia0 at pci0 dev 27 function 0 "Intel 3400 HD Audio" rev 0x06: msi
azalia0: codecs: Conexant/0x5069, Intel/0x2804, using Conexant/0x5069
audio0 at azalia0
ppb0 at pci0 dev 28 function 0 "Intel 3400 PCIE" rev 0x06: msi
pci1 at ppb0 bus 13
ppb1 at pci0 dev 28 function 4 "Intel 3400 PCIE" rev 0x06: msi
pci2 at ppb1 bus 2
iwn0 at pci2 dev 0 function 0 "Intel Centrino Advanced-N 6200" rev 0x35: msi,
MIMO 2T2R, MoW, address 00:23:14:2e:8a:c8
ehci1 at pci0 dev 29 function 0 "Intel 3400 USB" rev 0x06: apic 1 int 19
usb1 at ehci1: USB revision 2.0
uhub1 at usb1 "Intel EHCI root hub" rev 2.00/1.00 addr 1
ppb2 at pci0 dev 30 function 0 "Intel 82801BAM Hub-to-PCI" rev 0xa6
pci3 at ppb2 bus 14
pcib0 at pci0 dev 31 function 0 "Intel QM57 LPC" rev 0x06
ahci0 at pci0 dev 31 function 2 "Intel 3400 AHCI" rev 0x06: msi, AHCI 1.3
scsibus0 at ahci0: 32 targets
sd0 at scsibus0 targ 0 lun 0: <ATA, SAMSUNG MMCQE28G, VAM0> SCSI3 0/direct
fixed t10.ATA_SAMSUNG_MMCQE28G8MUP-0VA_SY924B3498_
sd0: 122104MB, 512 bytes/sector, 250069680 sectors
ichiic0 at pci0 dev 31 function 3 "Intel 3400 SMBus" rev 0x06: apic 1 int 23
iic0 at ichiic0
spdmem0 at iic0 addr 0x50: 4GB DDR3 SDRAM PC3-10600 SO-DIMM
itherm0 at pci0 dev 31 function 6 "Intel 3400 Thermal" rev 0x06
isa0 at pcib0
isadma0 at isa0
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 7.4
pcppi0 at isa0 port 0x61
spkr0 at pcppi0
aps0 at isa0 port 0x1600/31
mtrr: Pentium Pro MTRR support
uhub2 at uhub0 port 1 "Intel Rate Matching Hub" rev 2.00/0.00 addr 2
uhub3 at uhub1 port 1 "Intel Rate Matching Hub" rev 2.00/0.00 addr 2
umass0 at uhub3 port 1 configuration 1 interface 0 "Generic USB2.0-CRW" rev
2.00/58.88 addr 3
umass0: using SCSI over Bulk-Only
scsibus1 at umass0: 2 targets, initiator 0
sd1 at scsibus1 targ 1 lun 0: <Generic-, Multi-Card, 1.00> SCSI0 0/direct
removable serial.0bda0159114173400000
sd1: 1886MB, 512 bytes/sector, 3862528 sectors
vscsi0 at root
scsibus2 at vscsi0: 256 targets
softraid0 at root
scsibus3 at softraid0: 256 targets
root on sd0a (59050a9b7ada23c2.a) swap on sd0b dump on sd0b


--
There is a great discovery still to be made in Literature: that of
paying literary men by the quantity they do NOT write.

[demime 1.01d removed an attachment of type application/pgp-signature which had a name of signature.asc]

Reply | Threaded
Open this post in threaded view
|

Re: openBSD 5.2 amd64 on lenovo x201s, part 2 apm support and overheating

David Coppa
On Tue, Jan 29, 2013 at 11:17 AM, Andriy Samsonyuk
<[hidden email]> wrote:

> Hi,
>
> is apm/apmd the only wat to change the fan speen?
>
> The fan speen never goes above:
> hw.sensors.acpithinkpad0.fan0=4527 RPM
> +- few RPMs
>
> if i set apmd -C or -A the laptop powers off after a while
> without any warnings.
>
> with apm -L or -H its running, but getting hotter.
>
> Any suggestions/ideas?

Try this patch by zhuk@:

http://marc.info/?l=openbsd-tech&m=135645173413550

Ciao,
David

Reply | Threaded
Open this post in threaded view
|

Re: openBSD 5.2 amd64 on lenovo x201s, part 2 apm support and overheating

Brett Mahar-2
In reply to this post by Andriy Samsonyuk
On 01/29/13 21:17, Andriy Samsonyuk wrote:

> Hi,
>
> is apm/apmd the only wat to change the fan speen?
>
> The fan speen never goes above:
> hw.sensors.acpithinkpad0.fan0=4527 RPM
> +- few RPMs
>
> if i set apmd -C or -A the laptop powers off after a while
> without any warnings.
>
> with apm -L or -H its running, but getting hotter.
>
> Any suggestions/ideas?
>

You can use "sysctl hw.setperf" to permanently set the cpu to run at a
lower speed. On a laptop I used to have, sysctl hw.setperf=0 ran the cpu
at 800mhz. This did not have much of a noticable effect on performance,
unless I was trying to do some heavy compiling or such.

Your bios settings may also have an option to change the fan speed.

Reply | Threaded
Open this post in threaded view
|

Re: openBSD 5.2 amd64 on lenovo x201s, part 2 apm support and overheating

Stefan Sperling-8
In reply to this post by Andriy Samsonyuk
On Tue, Jan 29, 2013 at 11:17:10AM +0100, Andriy Samsonyuk wrote:

> Hi,
>
> is apm/apmd the only wat to change the fan speen?
>
> The fan speen never goes above:
> hw.sensors.acpithinkpad0.fan0=4527 RPM
> +- few RPMs
>
> if i set apmd -C or -A the laptop powers off after a while
> without any warnings.
>
> with apm -L or -H its running, but getting hotter.
>
> Any suggestions/ideas?

Try sucking dust out of the heat vent with a hoover.
That helped me once with a thinkpad that kept shutting down itself
due to overheating.

If you really want fan control and would be willing to patch the
kernel for it, see here for several patches to manually control
the fan on thinkpads: http://marc.info/?t=129104121700004&r=1&w=2
None of these were ever committed AFAIK.
I don't know if they still apply to -current.

Reply | Threaded
Open this post in threaded view
|

Re: openBSD 5.2 amd64 on lenovo x201s, part 2 apm support and overheating

David Coppa
In reply to this post by David Coppa
On Tue, 29 Jan 2013, David Coppa wrote:

> On Tue, Jan 29, 2013 at 11:17 AM, Andriy Samsonyuk
> <[hidden email]> wrote:
> > Hi,
> >
> > is apm/apmd the only wat to change the fan speen?
> >
> > The fan speen never goes above:
> > hw.sensors.acpithinkpad0.fan0=4527 RPM
> > +- few RPMs
> >
> > if i set apmd -C or -A the laptop powers off after a while
> > without any warnings.
> >
> > with apm -L or -H its running, but getting hotter.
> >
> > Any suggestions/ideas?
>
> Try this patch by zhuk@:
>
> http://marc.info/?l=openbsd-tech&m=135645173413550

Attached to this mail, at your convenience...

Ciao,
David
Index: acpithinkpad.c
===================================================================
RCS file: /cvs/src/sys/dev/acpi/acpithinkpad.c,v
retrieving revision 1.28
diff -u -p -r1.28 acpithinkpad.c
--- acpithinkpad.c 6 Jun 2011 06:13:46 -0000 1.28
+++ acpithinkpad.c 25 Dec 2012 15:19:25 -0000
@@ -76,11 +76,25 @@
 #define THINKPAD_POWER_CHANGED 0x6030
 #define THINKPAD_SWITCH_WIRELESS 0x7000
 
-#define THINKPAD_NSENSORS 9
-#define THINKPAD_NTEMPSENSORS 8
+#define THINKPAD_NSENSORS 10
+#define THINKPAD_NTEMPSENSORS 8
+
+#define THINKPAD_SENSOR_FANRPM (THINKPAD_NTEMPSENSORS + 0)
+#define THINKPAD_SENSOR_FANMODE (THINKPAD_NTEMPSENSORS + 1)
 
 #define THINKPAD_ECOFFSET_FANLO 0x84
 #define THINKPAD_ECOFFSET_FANHI 0x85
+#define THINKPAD_ECOFFSET_FANMODE 0x2f
+
+/* not used: #define THINKPAD_FANMODE_MIN 0x00 */
+#define THINKPAD_FANMODE_MAX 0x07
+#define THINKPAD_FANMODE_AUTO 0x80
+#define THINKPAD_FANMODE_DISENGAGED 0x40
+#define THINKPAD_FANMODE_FORCEMAX (THINKPAD_FANMODE_MAX | THINKPAD_FANMODE_DISENGAGED)
+
+/* critical temperature marks, in Celsius */
+#define THINKPAD_TEMP_OUCH_HMARK 80
+#define THINKPAD_TEMP_OUCH_LMARK 70
 
 struct acpithinkpad_softc {
  struct device sc_dev;
@@ -90,7 +104,10 @@ struct acpithinkpad_softc {
  struct aml_node *sc_devnode;
 
  struct ksensor sc_sens[THINKPAD_NSENSORS];
+#define sc_sensfanmode sc_sens[THINKPAD_SENSOR_FANMODE]
  struct ksensordev sc_sensdev;
+
+ u_int8_t sc_fanmodeinit;
 };
 
 extern void acpiec_read(struct acpiec_softc *, u_int8_t, int, u_int8_t *);
@@ -108,7 +125,7 @@ int thinkpad_volume_mute(struct acpithin
 int thinkpad_brightness_up(struct acpithinkpad_softc *);
 int thinkpad_brightness_down(struct acpithinkpad_softc *);
 
-void    thinkpad_sensor_attach(struct acpithinkpad_softc *sc);
+void    thinkpad_sensor_attach(struct acpithinkpad_softc *);
 void    thinkpad_sensor_refresh(void *);
 
 #if NAUDIO > 0 && NWSKBD > 0
@@ -165,8 +182,14 @@ thinkpad_sensor_attach(struct acpithinkp
  }
 
  /* Add fan probe */
- sc->sc_sens[i].type = SENSOR_FANRPM;
- sensor_attach(&sc->sc_sensdev, &sc->sc_sens[i]);
+ sc->sc_sens[THINKPAD_SENSOR_FANRPM].type = SENSOR_FANRPM;
+ sensor_attach(&sc->sc_sensdev, &sc->sc_sens[THINKPAD_SENSOR_FANRPM]);
+
+ /* Add fan mode indicator */
+ sc->sc_sens[THINKPAD_SENSOR_FANMODE].type = SENSOR_INTEGER;
+ sensor_attach(&sc->sc_sensdev, &sc->sc_sens[THINKPAD_SENSOR_FANMODE]);
+ acpiec_read(sc->sc_ec, THINKPAD_ECOFFSET_FANMODE, 1,
+    &sc->sc_fanmodeinit);
 
  sensordev_install(&sc->sc_sensdev);
 }
@@ -176,8 +199,10 @@ thinkpad_sensor_refresh(void *arg)
 {
  struct acpithinkpad_softc *sc = arg;
  u_int8_t lo, hi, i;
- int64_t tmp;
+ int64_t tmp, maxtmp = -127;    /* minimal correct value, see below */
+ int updatemode = 0;            /* should we bother BIOS? */
  char sname[5];
+ const char *desc;
 
  /* Refresh sensor readings */
  for (i=0; i<THINKPAD_NTEMPSENSORS; i++) {
@@ -185,14 +210,60 @@ thinkpad_sensor_refresh(void *arg)
  aml_evalinteger(sc->sc_acpi, sc->sc_ec->sc_devnode,
     sname, 0, 0, &tmp);
  sc->sc_sens[i].value = (tmp * 1000000) + 273150000;
- if (tmp > 127 || tmp < -127)
+ if (tmp > 127 || tmp < -127) {
  sc->sc_sens[i].flags = SENSOR_FINVALID;
+ sc->sc_sens[i].status = SENSOR_S_UNKNOWN;
+ }
+ if ((sc->sc_sens[i].flags & SENSOR_FINVALID) == SENSOR_FINVALID)
+ continue;
+ if (tmp > maxtmp)
+ maxtmp = tmp;
+ if (tmp > THINKPAD_TEMP_OUCH_HMARK)
+ sc->sc_sens[i].status = SENSOR_S_CRIT;
+ else if (tmp > THINKPAD_TEMP_OUCH_LMARK)
+ sc->sc_sens[i].status = SENSOR_S_WARN;
+ else
+ sc->sc_sens[i].status = SENSOR_S_OK;
  }
 
  /* Read fan RPM */
  acpiec_read(sc->sc_ec, THINKPAD_ECOFFSET_FANLO, 1, &lo);
  acpiec_read(sc->sc_ec, THINKPAD_ECOFFSET_FANHI, 1, &hi);
- sc->sc_sens[i].value = ((hi << 8L) + lo);
+ sc->sc_sens[THINKPAD_SENSOR_FANRPM].value = ((hi << 8L) + lo);
+
+ /*
+ * Update fan mode based on max temperature seen.
+ * If temperature is between THINKPAD_TEMP_OUCH_LMARK and
+ * THINKPAD_TEMP_OUCH_HMARK, we try to avoid setting fan mode
+ * to avoid extra spinning.
+ */
+
+ if (maxtmp > THINKPAD_TEMP_OUCH_HMARK) {
+ sc->sc_sensfanmode.value = THINKPAD_FANMODE_FORCEMAX;
+ sc->sc_sensfanmode.status = SENSOR_S_CRIT;
+ desc = "disengaged";
+ updatemode = 1;
+ } else if (maxtmp <= THINKPAD_TEMP_OUCH_LMARK) {
+ sc->sc_sensfanmode.value = sc->sc_fanmodeinit;
+ sc->sc_sensfanmode.status = SENSOR_S_OK;
+ desc = "auto";
+ updatemode = 1;
+ } else {
+ if (sc->sc_sensfanmode.status == SENSOR_S_UNSPEC) {
+ /* Better safe than sorry */
+ sc->sc_sensfanmode.value = THINKPAD_FANMODE_FORCEMAX;
+ desc = "disengaged";
+ updatemode = 1;
+ }
+ sc->sc_sensfanmode.status = SENSOR_S_WARN;
+ }
+
+ if (updatemode) {
+ snprintf(sc->sc_sensfanmode.desc,
+    sizeof(sc->sc_sensfanmode.desc), "fan mode: %s", desc);
+ acpiec_write(sc->sc_ec, THINKPAD_ECOFFSET_FANMODE, 1,
+    (u_int8_t*)&sc->sc_sensfanmode.value);
+ }
 }
 
 void

Reply | Threaded
Open this post in threaded view
|

Re: openBSD 5.2 amd64 on lenovo x201s, part 2 apm support and overheating

Gregor Best
In reply to this post by Stefan Sperling-8
On Tue, Jan 29, 2013 at 12:07:10PM +0100, Stefan Sperling wrote:
> [...]
> Try sucking dust out of the heat vent with a hoover.
> That helped me once with a thinkpad that kept shutting down itself
> due to overheating.
> [...]

FWIW, I'd unplug the fan before doing that. The suction from the vaccum
causes the fan to rotate, and in turn generate (a small amount of) power.
That power is fed into the fan controller where the controller expects
power to go _towards_ the fan instead of coming in, maybe damaging the
controller. I don't know whether that's still an issue with modern Thinkpads
but better safe than sorry.

--
    Gregor Best

Reply | Threaded
Open this post in threaded view
|

Re: openBSD 5.2 amd64 on lenovo x201s, part 2 apm support and overheating

Andriy Samsonyuk
Thanx for your replys. Cleaning the fan and heat sink helped
a bit, but not much (i cleaned it not so long ago).
Running with the lower CPU freq. helps too.
But neither of those solve the problem.
Apparently the max fan speed is 7000 RPM and it would
be nice if it could be used in the case of extremely high CPU load.

i hope to try the patches soon, but it would be nice to have
those features in the stable release

Regards,

Andriy

[demime 1.01d removed an attachment of type application/pgp-signature which had a name of signature.asc]

Reply | Threaded
Open this post in threaded view
|

Re: openBSD 5.2 amd64 on lenovo x201s, part 2 apm support and overheating

Vadim Zhukov
In reply to this post by Andriy Samsonyuk
2013/1/29 Andriy Samsonyuk <[hidden email]>:

> Hi,
>
> is apm/apmd the only wat to change the fan speen?
>
> The fan speen never goes above:
> hw.sensors.acpithinkpad0.fan0=4527 RPM
> +- few RPMs
>
> if i set apmd -C or -A the laptop powers off after a while
> without any warnings.
>
> with apm -L or -H its running, but getting hotter.
>
> Any suggestions/ideas?

David Coppa already sent you a patch but probably I should clarify
some things more.

Many modern ThinkPad allow to either delegate management of fan speed
to BIOS or to set it manually. OpenBSD point of view is that manual
setting fans from userland is a BAD idea. So what's the patch
mentioned does is taking management from BIOS to OS.

BIOS does a good thing at managing fan speed until it gets too hot.
But when overheating happens, there are two complimentary ways to
handle the situation: a) raise the fan speed; b) lower CPU speed.

(a) is what OpenBSD with the patch mentioned starts to do. The fan is
put in so called "disengaged" mode, fan goes to 6000+ RPM and became
spinning as if it's trying to make your laptop flying. This probably
could damage the fan, but mine is still there for about two years.

The same functionality exists in the Linux kernel but the code is
(was? Didn't check for a year) disabled; I've actually picked up
register addresses from there.

(b) is what Windows does. Your videoplayer will start dropping frames
but it'll be more or less quiet around.

Probably some overheating logic could be added to apmd(8), but this
daemon already wants too many options and thus probably needs
refactoring. Or there could be some default scripts for sensorsd(8)
written...

--
  WBR,
  Vadim Zhukov

Reply | Threaded
Open this post in threaded view
|

Re: openBSD 5.2 amd64 on lenovo x201s, part 2 apm support and overheating

Andriy Samsonyuk
i've applied your patch. So far it works!
Thanx again!

>
> David Coppa already sent you a patch but probably I should clarify
> some things more.
>
> Many modern ThinkPad allow to either delegate management of fan speed
> to BIOS or to set it manually. OpenBSD point of view is that manual
> setting fans from userland is a BAD idea. So what's the patch
> mentioned does is taking management from BIOS to OS.
>
> BIOS does a good thing at managing fan speed until it gets too hot.
> But when overheating happens, there are two complimentary ways to
> handle the situation: a) raise the fan speed; b) lower CPU speed.
>
> (a) is what OpenBSD with the patch mentioned starts to do. The fan is
> put in so called "disengaged" mode, fan goes to 6000+ RPM and became
> spinning as if it's trying to make your laptop flying. This probably
> could damage the fan, but mine is still there for about two years.
>
> The same functionality exists in the Linux kernel but the code is
> (was? Didn't check for a year) disabled; I've actually picked up
> register addresses from there.
>
> (b) is what Windows does. Your videoplayer will start dropping frames
> but it'll be more or less quiet around.
>
> Probably some overheating logic could be added to apmd(8), but this
> daemon already wants too many options and thus probably needs
> refactoring. Or there could be some default scripts for sensorsd(8)
> written...
>
> --
>   WBR,
>   Vadim Zhukov
>

--
Stay away from flying saucers today.

[demime 1.01d removed an attachment of type application/pgp-signature which had a name of signature.asc]