Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 20 Jun 2009 14:04:03 +0100
From:      Peter Harrison <peter.piggybox@virgin.net>
To:        David Naylor <naylor.b.david@gmail.com>
Cc:        freebsd-acpi@freebsd.org, Peter Harrison <peter.piggybox@virgin.net>
Subject:   Re: [PATCH] Lenovo S10(e) ACPI
Message-ID:  <20090620130403.GA1051@ideapad.piggybox>
In-Reply-To: <200906182100.15817.naylor.b.david@gmail.com>
References:  <200906181407.11607.naylor.b.david@gmail.com> <20090618174028.GA1023@ideapad.piggybox> <200906182100.15817.naylor.b.david@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Thursday, 18 June 2009 at 21:00:11 +0200, David Naylor said:
> On Thursday 18 June 2009 19:40:28 Peter Harrison wrote:
> > Thursday, 18 June 2009 at 14:07:07 +0200, David Naylor said:
> > > Hi,
> > >
> > > ((Short version: apply patch and add 'debug.acpi.ec.gpe=1'
> > > and 'debug.acpi.ec.timeout=100' to loader.conf and EC (battery,
> > > thermal) ?should? work))
> > >
> > > After lots of struggling I believe I have found a suitable workaround for
> > > this problem.  First, an overview of the problem:
> > >
> > > 1) Sometimes apci_ec0 doesn't attach properly because of EcRead timeout
> > > (patch should fix this).
> > > 2) Manytimes GPE (interrupt) mode timeout and switches to polling.  This
> > > causes the Embedded Control to get very upset, making ACPI go back to GPE
> > > mode (sysctl debug.acpi.ec.polling=0) fixes the problem until the next
> > > time GPE times out.  (patch provides workaround).
> > >
> > > On the latter point, the patch seems to fixes the problem if
> > > device_printf is called after each success.  This ends up spamming syslog
> > > (~3 per second). This, I'm guessing, has something to do with locking and
> > > providing a delay until the next call to the EC.
> > >
> > > This patch has not been tested with burst mode (which never worked) but
> > > does work with debug.acpi.ec.max_threads=1 (or 3).
> > >
> > > Next, how it works:
> > > 1) Apply patch and rebuild
> > > 2) Add 'debug.acpi.ec.gpe=1' to loader.conf (for the workaround for 2)
> > > 3) Add 'debug.acpi.ec.timeout=100' (or even 50) to loader.conf (to
> > > minimise impact of GPE timeout).
> > >
> > > This should allow EC to work (does on my Lenovo S10e), which means
> > > battery and temperature status and poweroff should work as expected
> > > (besides a few error messages on syslog).
> > >
> > > WARNING: Beware, slippery when wet, may eat babies (or baby computers),
> > > use at your own risk (but it does work for me).
> > >
> > > Regards,
> > >
> > > David
> > >
> > > P.S. If this doesn't work please include details (and dmesg output) and
> > > I'll try to help.
> >
> > David,
> >
> > Thanks for this. I'll try the patch and report back. I'm running
> > 7.2-RELEASE at the moment, do you expect it to work on this, or should I
> > move up to STABLE (or CURRENT)?
> 
> That patch should apply cleanly to 7.2 (with some minor offsetting).  I don't 
> think anything should have changed since then that would stop this from 
> working.  
> 
> This patch seems to be more of a workaround than a fix.  

David,

The patch applied cleanly, and I've rebuilt and installed. System seems to work fine and I'm getting battery time reported properly. It still won't poweroff on shutdown though...

Thanks for the help.


Peter Harrison.

uname -a:
FreeBSD ideapad.piggybox 7.2-RELEASE-p1 FreeBSD 7.2-RELEASE-p1 #0: Sat Jun 20 11:03:21 BST 2009     peter@ideapad.piggybox:/usr/obj/usr/src/sys/GENERIC  i386

dmesg:
Copyright (c) 1992-2009 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 7.2-RELEASE-p1 #0: Sat Jun 20 11:03:21 BST 2009
    peter@ideapad.piggybox:/usr/obj/usr/src/sys/GENERIC
Timecounter "i8254" frequency 1193182 Hz quality 0
CPU: Intel(R) Atom(TM) CPU N270   @ 1.60GHz (1596.02-MHz 686-class CPU)
  Origin = "GenuineIntel"  Id = 0x106c2  Stepping = 2
  Features=0xbfe9fbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,CLFLUSH,DTS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE>
  Features2=0x40c39d<SSE3,DTES64,MON,DS_CPL,EST,TM2,SSSE3,xTPR,PDCM,<b22>>
  AMD Features=0x100000<NX>
  AMD Features2=0x1<LAHF>
  Logical CPUs per core: 2
real memory  = 1064108032 (1014 MB)
avail memory = 1023393792 (975 MB)
ACPI APIC Table: <INTEL  CALISTGA>
FreeBSD/SMP: Multiprocessor System Detected: 2 CPUs
 cpu0 (BSP): APIC ID:  0
 cpu1 (AP/HT): APIC ID:  1
ioapic0: Changing APIC ID to 1
ioapic0 <Version 2.0> irqs 0-23 on motherboard
kbd1 at kbdmux0
acpi0: <PTLTD 	 XSDT> on motherboard
acpi0: [ITHREAD]
acpi0: Power Button (fixed)
Timecounter "HPET" frequency 14318180 Hz quality 900
Timecounter "ACPI-safe" frequency 3579545 Hz quality 850
acpi_timer0: <24-bit timer at 3.579545MHz> port 0x1008-0x100b on acpi0
acpi_ec0: <Embedded Controller: GPE 0x17> port 0x62,0x66 on acpi0
acpi_button0: <Power Button> on acpi0
acpi_button1: <Sleep Button> on acpi0
acpi_acad0: <AC Adapter> on acpi0
battery0: <ACPI Control Method Battery> on acpi0
acpi_lid0: <Control Method Lid Switch> on acpi0
pcib0: <ACPI Host-PCI bridge> port 0xcf8-0xcff on acpi0
pci0: <ACPI PCI bus> on pcib0
vgapci0: <VGA-compatible display> port 0x1800-0x1807 mem 0xf0500000-0xf057ffff,0xd0000000-0xdfffffff,0xf0600000-0xf063ffff irq 16 at device 2.0 on pci0
agp0: <Intel 945GME SVGA controller> on vgapci0
agp0: detected 7932k stolen memory
agp0: aperture size is 256M
vgapci1: <VGA-compatible display> mem 0xf0580000-0xf05fffff at device 2.1 on pci0
hdac0: <Intel 82801G High Definition Audio Controller> mem 0xf0640000-0xf0643fff irq 22 at device 27.0 on pci0
hdac0: HDA Driver Revision: 20090329_0131
hdac0: [ITHREAD]
pcib1: <ACPI PCI-PCI bridge> irq 17 at device 28.0 on pci0
pci2: <ACPI PCI bus> on pcib1
bge0: <Broadcom BCM5906 A2, ASIC rev. 0xc002> mem 0xf0200000-0xf020ffff irq 16 at device 0.0 on pci2
miibus0: <MII bus> on bge0
brgphy0: <BCM5906 10/100baseTX PHY> PHY 1 on miibus0
brgphy0:  10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
bge0: Ethernet address: 00:23:8b:34:79:8a
bge0: [ITHREAD]
pcib2: <ACPI PCI-PCI bridge> irq 16 at device 28.1 on pci0
pci3: <ACPI PCI bus> on pcib2
pcib3: <ACPI PCI-PCI bridge> irq 18 at device 28.2 on pci0
pci5: <ACPI PCI bus> on pcib3
ndis0: <Broadcom 802.11g Network Adapter> mem 0xf0400000-0xf0403fff irq 18 at device 0.0 on pci5
ndis0: [ITHREAD]
ndis0: NDIS API version: 5.1
ndis0: WARNING: using obsoleted if_watchdog interface
ndis0: Ethernet address: 00:23:4e:93:a4:de
uhci0: <UHCI (generic) USB controller> port 0x1820-0x183f irq 23 at device 29.0 on pci0
uhci0: [GIANT-LOCKED]
uhci0: [ITHREAD]
usb0: <UHCI (generic) USB controller> on uhci0
usb0: USB revision 1.0
uhub0: <Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1> on usb0
uhub0: 2 ports with 2 removable, self powered
uhci1: <UHCI (generic) USB controller> port 0x1840-0x185f irq 19 at device 29.1 on pci0
uhci1: [GIANT-LOCKED]
uhci1: [ITHREAD]
usb1: <UHCI (generic) USB controller> on uhci1
usb1: USB revision 1.0
uhub1: <Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1> on usb1
uhub1: 2 ports with 2 removable, self powered
uhci2: <UHCI (generic) USB controller> port 0x1860-0x187f irq 18 at device 29.2 on pci0
uhci2: [GIANT-LOCKED]
uhci2: [ITHREAD]
usb2: <UHCI (generic) USB controller> on uhci2
usb2: USB revision 1.0
uhub2: <Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1> on usb2
uhub2: 2 ports with 2 removable, self powered
uhci3: <UHCI (generic) USB controller> port 0x1880-0x189f irq 16 at device 29.3 on pci0
uhci3: [GIANT-LOCKED]
uhci3: [ITHREAD]
usb3: <UHCI (generic) USB controller> on uhci3
usb3: USB revision 1.0
uhub3: <Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1> on usb3
uhub3: 2 ports with 2 removable, self powered
ehci0: <Intel 82801GB/R (ICH7) USB 2.0 controller> mem 0xf0844000-0xf08443ff irq 23 at device 29.7 on pci0
ehci0: [GIANT-LOCKED]
ehci0: [ITHREAD]
usb4: EHCI version 1.0
usb4: companion controllers, 2 ports each: usb0 usb1 usb2 usb3
usb4: <Intel 82801GB/R (ICH7) USB 2.0 controller> on ehci0
usb4: USB revision 2.0
uhub4: <Intel EHCI root hub, class 9/0, rev 2.00/1.00, addr 1> on usb4
uhub4: 8 ports with 8 removable, self powered
ugen0: <BISON Corporation Lenovo EasyCamera, class 239/2, rev 2.00/14.04, addr 2> on uhub4
umass0: <Generic USB2.0-CRW, class 0/0, rev 2.00/58.87, addr 3> on uhub4
pcib4: <ACPI PCI-PCI bridge> at device 30.0 on pci0
pci6: <ACPI PCI bus> on pcib4
isab0: <PCI-ISA bridge> at device 31.0 on pci0
isa0: <ISA bus> on isab0
atapci0: <Intel ICH7 UDMA100 controller> port 0x1f0-0x1f7,0x3f6,0x170-0x177,0x376,0x1810-0x181f at device 31.1 on pci0
ata0: <ATA channel 0> on atapci0
ata0: [ITHREAD]
atapci1: <Intel ICH7M SATA300 controller> port 0x18c8-0x18cf,0x18c0-0x18c3,0x18a8-0x18af,0x180c-0x180f,0x18b0-0x18bf mem 0xf0844400-0xf08447ff irq 19 at device 31.2 on pci0
atapci1: [ITHREAD]
atapci1: AHCI called from vendor specific driver
atapci1: AHCI Version 01.10 controller with 4 ports detected
ata2: <ATA channel 0> on atapci1
ata2: [ITHREAD]
ata3: <ATA channel 1> on atapci1
ata3: port not implemented
ata3: [ITHREAD]
ata4: <ATA channel 2> on atapci1
ata4: [ITHREAD]
ata5: <ATA channel 3> on atapci1
ata5: port not implemented
ata5: [ITHREAD]
pci0: <serial bus, SMBus> at device 31.3 (no driver attached)
acpi_tz0: <Thermal Zone> on acpi0
atkbdc0: <Keyboard controller (i8042)> port 0x60,0x64 irq 1 on acpi0
atkbd0: <AT Keyboard> irq 1 on atkbdc0
kbd0 at atkbd0
atkbd0: [GIANT-LOCKED]
atkbd0: [ITHREAD]
psm0: <PS/2 Mouse> irq 12 on atkbdc0
psm0: [GIANT-LOCKED]
psm0: [ITHREAD]
psm0: model Generic PS/2 mouse, device ID 0
cpu0: <ACPI CPU> on acpi0
est0: <Enhanced SpeedStep Frequency Control> on cpu0
p4tcc0: <CPU Frequency Thermal Control> on cpu0
cpu1: <ACPI CPU> on acpi0
est1: <Enhanced SpeedStep Frequency Control> on cpu1
p4tcc1: <CPU Frequency Thermal Control> on cpu1
pmtimer0 on isa0
orm0: <ISA Option ROMs> at iomem 0xdf000-0xdf7ff,0xe0000-0xe17ff pnpid ORM0000 on isa0
ppc0: parallel port not found.
sc0: <System console> at flags 0x100 on isa0
sc0: VGA <16 virtual consoles, flags=0x300>
sio0: configured irq 4 not in bitmap of probed irqs 0
sio0: port may not be enabled
sio0: configured irq 4 not in bitmap of probed irqs 0
sio0: port may not be enabled
sio0 at port 0x3f8-0x3ff irq 4 flags 0x10 on isa0
sio0: type 8250 or not responding
sio0: [FILTER]
sio1: configured irq 3 not in bitmap of probed irqs 0
sio1: port may not be enabled
vga0: <Generic ISA VGA> at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0
ugen1: <Broadcom Corp BCM2046 Bluetooth Device, class 224/1, rev 2.00/6.01, addr 2> on uhub1
Timecounters tick every 1.000 msec
ad4: 76319MB <HITACHI HTS543280L9SA00 FB1ZC43C> at ata2-master SATA150
hdac0: HDA Codec #0: Realtek ALC269
pcm0: <HDA Realtek ALC269 PCM #0 Analog> at cad 0 nid 1 on hdac0
GEOM_LABEL: Label for provider ad4s1a is ufsid/4a20f9c76d1ce80d.
GEOM_LABEL: Label for provider ad4s1d is ufsid/4a20f9cb4eb76445.
GEOM_LABEL: Label for provider ad4s1e is ufsid/4a20f9c7c991bdb8.
GEOM_LABEL: Label for provider ad4s1f is ufsid/4a20f9c769a0ccbb.
(probe0:umass-sim0:0:0:0): TEST UNIT READY. CDB: 0 0 0 0 0 0 
(probe0:umass-sim0:0:0:0): CAM Status: SCSI Status Error
(probe0:umass-sim0:0:0:0): SCSI Status: Check Condition
(probe0:umass-sim0:0:0:0): NOT READY asc:3a,0
(probe0:umass-sim0:0:0:0): Medium not present
(probe0:umass-sim0:0:0:0): Unretryable error
SMP: AP CPU #1 Launched!
da0 at umass-sim0 bus 0 target 0 lun 0
da0: <Generic- Multi-Card 1.00> Removable Direct Access SCSI-0 device 
da0: 40.000MB/s transfers
da0: Attempt to query device size failed: NOT READY, Medium not present
Trying to mount root from ufs:/dev/ad4s1a
GEOM_LABEL: Label ufsid/4a20f9c76d1ce80d removed.
GEOM_LABEL: Label for provider ad4s1a is ufsid/4a20f9c76d1ce80d.
GEOM_LABEL: Label ufsid/4a20f9c7c991bdb8 removed.
GEOM_LABEL: Label for provider ad4s1e is ufsid/4a20f9c7c991bdb8.
GEOM_LABEL: Label ufsid/4a20f9c769a0ccbb removed.
GEOM_LABEL: Label for provider ad4s1f is ufsid/4a20f9c769a0ccbb.
GEOM_LABEL: Label ufsid/4a20f9cb4eb76445 removed.
GEOM_LABEL: Label for provider ad4s1d is ufsid/4a20f9cb4eb76445.
GEOM_LABEL: Label ufsid/4a20f9c76d1ce80d removed.
GEOM_LABEL: Label ufsid/4a20f9c7c991bdb8 removed.
GEOM_LABEL: Label ufsid/4a20f9c769a0ccbb removed.
GEOM_LABEL: Label ufsid/4a20f9cb4eb76445 removed.
ndis0: link state changed to UP
drm0: <Intel i945GME> on vgapci0
vgapci0: child drm0 requested pci_enable_busmaster
info: [drm] AGP at 0xd0000000 256MB
info: [drm] Initialized i915 1.6.0 20080730
drm0: [ITHREAD]



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090620130403.GA1051>