X220 suspend/resume debugging on 10-CURRENT

2012-10-17 Thread Любомир Григоров
I decided to play around with suspend/resume on my X220 for a while and
here are my findings. I hope this helps to bring a solution to a working
suspend/resume in X220 (BTW it's reported as working correctly in X1).
Below my tests are also the relevant outputs of dmesg, devinfo -rv and
pciconf -clv.

- testing was done in console mode
$ uname -a
FreeBSD LGX 10.0-CURRENT FreeBSD 10.0-CURRENT #2: Tue Oct 9 11:37:31 PDT
2012 alakazam@LGX:/usr/obj/usr/src/sys/GENERIC amd64

- With acpi_ibm.ko unloaded, it suspends with acpiconf -s 3
- Power led is blinking
- Beeps on suspend, beeps on resume
- Screen resumes off.
- Keyboard works and I am able to reboot
- kldload acpi_ibm kldload vesa kldload i915kms do nothing

- With acpi_ibm.ko loaded, it suspends with acpiconf -s 3
- Power led is blinking
- Beeps on suspend, beeps on resume
- Screen resumes off
- Keyboard works and I am able to reboot
- kldload vesa kldload i915kms do nothing

- With acpi_ibm.ko loaded, sysctl debug.acpi.suspend_bounce=1, it doesn't
suspend with  acpiconf -s 3
- Doesn't suspend
- Screen is on, but it's all black
 - Keyboard works and I am able to reboot
- kldload vesa kldload i915kms do nothing

- With acpi_ibm.ko and i915kms.ko loaded, it suspends with acpiconf -s 3
- Screen turns off after loading module, solution is to startx, but I am
not testing that.
- Power led is blinking
- Beeps on suspend, beeps on resume
- Screen resumes off
- startx turns on screen, but it's black with random line in top left.
- kldload vesa kldload i915kms do nothing



==
Copyright (c) 1992-2012 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 10.0-CURRENT #2: Tue Oct 9 11:37:31 PDT 2012
alakazam@LGX:/usr/obj/usr/src/sys/GENERIC amd64
WARNING: WITNESS option enabled, expect reduced performance.
CPU: Intel(R) Core(TM) i5-2520M CPU @ 2.50GHz (2491.97-MHz K8-class CPU)
Origin = GenuineIntel Id = 0x206a7 Family = 0x6 Model = 0x2a Stepping = 7
Features=0xbfebfbffFPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,DTS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE
Features2=0x1fbae3ffSSE3,PCLMULQDQ,DTES64,MON,DS_CPL,VMX,SMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,POPCNT,TSCDLT,AESNI,XSAVE,OSXSAVE,AVX
AMD Features=0x28100800SYSCALL,NX,RDTSCP,LM
AMD Features2=0x1LAHF
TSC: P-state invariant, performance statistics
real memory = 17179869184 (16384 MB)
avail memory = 16408248320 (15648 MB)
Event timer LAPIC quality 600
ACPI APIC Table: LENOVO TP-8D 
FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs
FreeBSD/SMP: 1 package(s) x 2 core(s) x 2 SMT threads
cpu0 (BSP): APIC ID: 0
cpu1 (AP): APIC ID: 1
cpu2 (AP): APIC ID: 2
cpu3 (AP): APIC ID: 3
ioapic0 Version 2.0 irqs 0-23 on motherboard
kbd1 at kbdmux0
hpt27xx: RocketRAID 27xx controller driver v1.0 (Oct 9 2012 11:36:43)
ctl: CAM Target Layer loaded
acpi0: LENOVO TP-8D on motherboard
acpi_ec0: Embedded Controller: GPE 0x11, ECDT port 0x62,0x66 on acpi0
acpi0: Power Button (fixed)
acpi0: reservation of 0, a (3) failed
acpi0: reservation of 10, df90 (3) failed
cpu0: ACPI CPU on acpi0
cpu1: ACPI CPU on acpi0
cpu2: ACPI CPU on acpi0
cpu3: ACPI CPU on acpi0
attimer0: AT timer port 0x40-0x43 irq 0 on acpi0
Timecounter i8254 frequency 1193182 Hz quality 0
Event timer i8254 frequency 1193182 Hz quality 100
hpet0: High Precision Event Timer iomem 0xfed0-0xfed003ff on acpi0
Timecounter HPET frequency 14318180 Hz quality 950
Event timer HPET frequency 14318180 Hz quality 550
Event timer HPET1 frequency 14318180 Hz quality 440
Event timer HPET2 frequency 14318180 Hz quality 440
Event timer HPET3 frequency 14318180 Hz quality 440
Event timer HPET4 frequency 14318180 Hz quality 440
atrtc0: AT realtime clock port 0x70-0x71 irq 8 on acpi0
Event timer RTC frequency 32768 Hz quality 0
Timecounter ACPI-fast frequency 3579545 Hz quality 900
acpi_timer0: 24-bit timer at 3.579545MHz port 0x408-0x40b on acpi0
acpi_lid0: Control Method Lid Switch on acpi0
acpi_button0: Sleep Button on acpi0
pcib0: ACPI Host-PCI bridge port 0xcf8-0xcff on acpi0
pci0: ACPI PCI bus on pcib0
vgapci0: VGA-compatible display port 0x5000-0x503f mem
0xf000-0xf03f,0xe000-0xefff irq 16 at device 2.0 on pci0
agp0: SandyBridge mobile GT2+ IG on vgapci0
agp0: aperture size is 256M, detected 65532k stolen memory
pci0: simple comms at device 22.0 (no driver attached)
em0: Intel(R) PRO/1000 Network Connection 7.3.2 port 0x5080-0x509f mem
0xf250-0xf251,0xf252b000-0xf252bfff irq 20 at device 25.0 on pci0
em0: Using an MSI interrupt
em0: Ethernet address: f0:de:f1:dd:a2:6f
ehci0: EHCI (generic) USB 2.0 controller mem 0xf252a000-0xf252a3ff irq 16
at device 26.0 on pci0
usbus0: EHCI version 1.0
usbus0 on ehci0
hdac0: Intel Cougar Point HDA Controller mem 0xf252-0xf2523fff irq 22
at device 27.0 on pci0
pcib1: ACPI PCI-PCI bridge 

Re: x220 notes

2012-10-17 Thread Ian Smith
On Tue, 16 Oct 2012, ???  wrote:

  I set a lower light (5-6) during BIOS boot, and if needed I modify manually
  in X. I monitored my CPU usage and did notice that the CPU takes its sweet
  time to lower the frequency (Windows keeps the frequency the same 99.67,
  but changes the multiplier from 8 to 32). I don't know if FreeBSD does that
  or it only manipulates the frequency. The multiplier makes more sense.
  Also, CPU cores in X stay at 50C. In Windows at no activicy they drop to
  44C and if no strenuous activity for a while, to 40C.
  
  It would be great if FreeBSD could downgrade the frequency faster upon no
  load. I use this:
  powerd_flags=-a hiadaptive -b adaptive -i 85 -r 60 -p 100

powerd(8) says:
 Adaptive mode attempts to strike a balance by degrading performance when
 the system appears idle and increasing it when the system is busy.  It
 offers a good balance between a small performance loss for greatly
 increased power savings.  Hiadaptive mode is like adaptive mode, but
 tuned for systems where performance and interactivity are more important
 than power consumption.  It increases frequency faster, reduces the fre-
 quency less aggressively and will maintain full frequency for longer.

So you want to use adaptive rather than hiadaptive, as power consumption 
is more important to you.  Also, -i probably should be lower than -r, as 
when load is less than 85% it will decrease frequency, but if it's then 
still higher than 60% powerd might kick it up again.  After experiments 
I wound up using -a adp -b adp -i 50 -r 80 -p 200 which is nearer the 
defaults, but mine is only a two-speed P3 and not so indicative for you.

Best way is likely to stop powerd (service powerd stop) then run 'powerd 
-v ..' in a root terminal - maybe using script(1) to record results - 
and watch it dance under various sorts of load, with different -i and -r 
parameters.  You will clearly see the difference between adp and hadp.

  I am always looking for the perfect FreeBSD laptop, but I guess it just
  doesn't exist. And I do need my 7-8 hours of battery with wireless on. If
  you guys have any suggestions on further optimizing the power usage and
  automating the regulation, please let me know (like turning off and on USB
  devices, spinning down the HDD, etc), also if you know about controlling
  the multiplier instead of the frequency.

Adrian, true to form, has pounced on your wireless :)

I'm not a fan of spinning down HDs myself; if you do, you need to watch 
out for the dreaded Load Cycle Count issue (see ataidle(8)), and things 
like cron tasks that may spin it back up frequently.  This and very much 
more information on power saving by Alexander Motin - who most recently 
updated powerd and added eventtimers(4) to 9.X - in his excellent guide:

 http://wiki.freebsd.org/TuningPowerConsumption

As for the multiplier thing, it depends on which cpufreq(4) drivers your 
system is using.  If it's a Core 2 Duo or i{5,7}, then both voltage and 
frequency are controlled, frequency by changing multiplier I assume; you 
should look at the code used by your processor.  Also, don't miss advice 
there and elsewhere to disable throttling and just use est cpufreq(4) 
drivers, and for using C states to advantage.  Before and after doing 
all that, compare differences for:

% sysctl dev.cpu.0.freq_levels
% sysctl dev.cpu |grep cx

cheers, Ian
___
freebsd-acpi@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-acpi
To unsubscribe, send any mail to freebsd-acpi-unsubscr...@freebsd.org


Re: Dell acpi_video patch

2012-10-17 Thread Alberto Villa
On Mon, Oct 15, 2012 at 5:12 PM, John Baldwin j...@freebsd.org wrote:
 Interesting.  Can you get an acpidump?

Sure:
http://people.FreeBSD.org/~avilla/files/avilla.asl.gz

I'd be glad to solve my problems with ACPI!
-- 
Alberto Villa, FreeBSD committer avi...@freebsd.org
http://people.FreeBSD.org/~avilla
___
freebsd-acpi@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-acpi
To unsubscribe, send any mail to freebsd-acpi-unsubscr...@freebsd.org