From owner-freebsd-acpi@FreeBSD.ORG Thu Jul 23 21:53:51 2009 Return-Path: Delivered-To: freebsd-acpi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 542C01065690 for ; Thu, 23 Jul 2009 21:53:51 +0000 (UTC) (envelope-from peter.piggybox@virgin.net) Received: from mtaout02-winn.ispmail.ntl.com (mtaout02-winn.ispmail.ntl.com [81.103.221.48]) by mx1.freebsd.org (Postfix) with ESMTP id CE0F48FC22 for ; Thu, 23 Jul 2009 21:53:50 +0000 (UTC) (envelope-from peter.piggybox@virgin.net) Received: from know-smtpout-3.server.virginmedia.net ([62.254.123.3]) by mtaout02-winn.ispmail.ntl.com (InterMail vM.7.08.04.00 201-2186-134-20080326) with ESMTP id <20090723215349.OLHL6611.mtaout02-winn.ispmail.ntl.com@know-smtpout-3.server.virginmedia.net>; Thu, 23 Jul 2009 22:53:49 +0100 Received: from [86.25.235.220] (helo=ideapad.piggybox) by know-smtpout-3.server.virginmedia.net with esmtp (Exim 4.63) (envelope-from ) id 1MU6EX-0005hS-Cj; Thu, 23 Jul 2009 22:53:49 +0100 Received: from ideapad.piggybox (localhost [127.0.0.1]) by ideapad.piggybox (8.14.3/8.14.3) with ESMTP id n6NKqrXf001103; Thu, 23 Jul 2009 21:52:53 +0100 (BST) (envelope-from peter@ideapad.piggybox) Received: (from peter@localhost) by ideapad.piggybox (8.14.3/8.14.3/Submit) id n6NKqrSN001102; Thu, 23 Jul 2009 21:52:53 +0100 (BST) (envelope-from peter) Date: Thu, 23 Jul 2009 21:52:53 +0100 From: Peter Harrison To: David Naylor Message-ID: <20090723205253.GB1084@ideapad.piggybox> References: <200906181407.11607.naylor.b.david@gmail.com> <200907131447.24702.naylor.b.david@gmail.com> <20090713195836.GA1093@ideapad.piggybox> <200907201859.21882.naylor.b.david@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200907201859.21882.naylor.b.david@gmail.com> User-Agent: Mutt/1.4.2.3i X-Cloudmark-Analysis: v=1.0 c=1 a=boODqf58grWqBSa2vX4A:9 a=hqw-YgwmAdZrvnhiq68A:7 a=jHCe6pHdd8xMkr4cbVYOOVQp3NgA:4 a=N753php2upYA:10 a=yJgJtKD6vqZYhpm6:21 a=m_N0BRlcUvwkV_RN:21 Cc: freebsd-acpi@freebsd.org, Peter Harrison Subject: Re: [PATCH] Lenovo S10(e) ACPI X-BeenThere: freebsd-acpi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: ACPI and power management development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jul 2009 21:53:51 -0000 Monday, 20 July 2009 at 18:59:18 +0200, David Naylor said: > Hi, > > How is the testing going? I've actually had the symptom you described (twice > I think). In my case the screen goes blank (but still on) and no power off. My symptoms are the same - though I didn't describe them quite so well. > > The first time the battery was dead when it shouldn't have (didn't wait for it > to power down), the second I was there to 'witness' it. > > These are, for me, very sporadic events. Since some timeouts still occur I > suspect one is happening for the shutdown command. See at the bottom for a > quick discussion. > > On Monday 13 July 2009 21:58:36 Peter Harrison wrote: > > > First some diagnostics, please do the following: > > > 1) On a console: > > > # 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 > > Upgrading to 8 might improve things. I'd rather wait for 8-RELEASE for that, but I'll think about it. > > > > # sysctl debug.acpi > > > > debug.acpi.suspend_bounce: 0 > > debug.acpi.do_powerstate: 1 > > debug.acpi.acpi_ca_version: 20070320 > > debug.acpi.ec.timeout: 100 > > debug.acpi.ec.polled: 0 > > debug.acpi.ec.gpe: 1 > > debug.acpi.ec.delay: 200 > > debug.acpi.ec.burst: 0 > > debug.acpi.batt.batt_sleep_ms: 0 > > debug.acpi.semaphore_debug: 0 > > debug.acpi.resume_beep: 0 > > Everything looks good, although your acpi_ca_version is outdated (newer > in -current). Increasing timeout might help (say 750), also increasing delay > won't hurt [don't forget delay is in microseconds whereas timeout is in > milliseconds]. I've fiddled with both the delay and timeout numbers, and don't seem to be able to make a consistent difference. > > > > 2) What version are you using (I've got the S10e)? > > > > S10e - BIOS reports model number 40684AG > > Same (except XG suffix) > > > > 3) What version of the BIOS are you running? > > > > BIOS version is 14CN51WW > > Difference, I've got 14CN67WW. I'll be interested to know how you flash your > system (if you don't have Windows installed). Looking over the Lenovo site, I don't see a way to run the utility unless I'm running Windows (which I'm not). Reading the notes, it seems there has been a change to the acpi code in the updates too. I need to try and find a way around this. > > > > 4) Is there any predictors as to when the system will not shutdown? > > > > Not that I've been able to determine. I thought at one point that it had to > > do with the amount of charge in the battery, or whether it was mains > > connected. But I can't detect a pattern. > > Same > > > > 5) What are the last messages printed on the console (when shutdown > > > fails)? > > > > Sometimes normal 'Syncing disks, vnodes remaining...' sometimes the correct > > message but garbled. > > > > Whether the message is garbled or not seems to have no bearing on whether > > the system powers off or not. > > My suspected solution: > > If I understand the situation correctly, in spite of my hackery there is still > a timeout happening. This sometimes happens at the most unfortunate time of > a powerdown preventing the BIOS from receiving the command to switch of > power. > > I suspect that FreeBSD doesn't try to reissue the power down command if it > fails and just abandons things. If I understand the Linux code correctly in > the heart of the acpi_ec code: if there is a command timeout it will reset > the EC and reissue the command, so in effect Linux reissues. > > One place to look is the ACPI shutdown code and make it retry a power-down if > it fails, or make the acpi_ec more robust to EC timeouts. > > I think this will be a good time to consult someone who actually has an > understanding of ACPI (especially the EC). > > Any ideas welcome. Ditto. But thanks for all the help and support so far. Peter Harrison. > > Regards