From owner-freebsd-acpi@FreeBSD.ORG Tue Oct 5 18:00:08 2010 Return-Path: Delivered-To: freebsd-acpi@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 066BE106564A for ; Tue, 5 Oct 2010 18:00:07 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id BA91C8FC15 for ; Tue, 5 Oct 2010 18:00:07 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o95I07nO031873 for ; Tue, 5 Oct 2010 18:00:07 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o95I07HB031862; Tue, 5 Oct 2010 18:00:07 GMT (envelope-from gnats) Date: Tue, 5 Oct 2010 18:00:07 GMT Message-Id: <201010051800.o95I07HB031862@freefall.freebsd.org> To: freebsd-acpi@FreeBSD.org From: David Naylor Cc: Subject: Re: kern/150517: [acpi] acpi_ec does not work properly on Lenovo S10[e] (due to dynamic switching to polled mode) X-BeenThere: freebsd-acpi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: David Naylor List-Id: ACPI and power management development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Oct 2010 18:00:08 -0000 The following reply was made to PR kern/150517; it has been noted by GNATS. From: David Naylor To: Andriy Gapon Cc: bug-followup@freebsd.org Subject: Re: kern/150517: [acpi] acpi_ec does not work properly on Lenovo S10[e] (due to dynamic switching to polled mode) Date: Tue, 5 Oct 2010 19:54:14 +0200 --nextPart3785335.Aben0vuXi3 Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable On Tuesday 05 October 2010 11:09:02 Andriy Gapon wrote: > on 02/10/2010 09:31 David Naylor said the following: > > On Monday 27 September 2010 07:53:51 Andriy Gapon wrote: > >> Since you already looked at the linux code, could you please post a li= nk > >> to a place where the problematic condition is handled there? > >>=20 > >> P.S. A service like http://lxr.linux.no/ or similar might be convenien= t. > >=20 > > Sorry for the slow reply. Your email was mistaken as spam. I've told > > gmail to behave. > >=20 > > It has been a long time since I looked at the code. The function in > > question is http://lxr.linux.no/linux+v2.6.35.7/drivers/acpi/ec.c#L217 > > with the actual check for controller reset at L238. > >=20 > > Of note is the delay at L254. It looks like it is almost the same thing > > my patch does, except it waits before whereas my patch waits after. >=20 > David, >=20 > can you dig up what kind of error messages you were getting from EC before > your patch? I ran a stress test of the EC by doing `while true; do acpiconf -i0; done` = and=20 the error messages that produced are: acpi_ec0: wait timed out (no response), forcing polled mode acpi_ec0: EcRead: failed waiting to get data ACPI Exception: AE_NO_HARDWARE_RESPONSE, Returned by Handler for=20 [EmbeddedControl] (20100915/evregion-588) ACPI Error: Method parse/execution failed [\\_SB_.BAT0._STA] (Node=20 0xc4328520), AE_NO_HARDWARE_RESPONSE (20100915/psparse-633) ACPI Error: Method execution failed [\\_SB_.BAT0._STA] (Node 0xc4328520),=20 AE_NO_HARDWARE_RESPONSE (20100915/uteval-185) acpi_ec0: EcRead: failed waiting to get data ACPI Exception: AE_NO_HARDWARE_RESPONSE, Returned by Handler for=20 [EmbeddedControl] (20100915/evregion-588) ACPI Error: Method parse/execution failed [\\_SB_.BAT0._STA] (Node=20 0xc4328520), AE_NO_HARDWARE_RESPONSE (20100915/psparse-633) ACPI Error: Method execution failed [\\_SB_.BAT0._STA] (Node 0xc4328520),=20 AE_NO_HARDWARE_RESPONSE (20100915/uteval-185) acpi_ec0: EcRead: failed waiting to get data ACPI Exception: AE_NO_HARDWARE_RESPONSE, Returned by Handler for=20 [EmbeddedControl] (20100915/evregion-588) ACPI Error: Method parse/execution failed [\\_SB_.BAT0.UPBS] (Node=20 0xc43284a0), AE_NO_HARDWARE_RESPONSE (20100915/psparse-633) ACPI Error: Method parse/execution failed [\\_SB_.BAT0._BST] (Node=20 0xc43284e0), AE_NO_HARDWARE_RESPONSE (20100915/psparse-633) acpi_ec0: EcRead: failed waiting to get data ACPI Exception: AE_NO_HARDWARE_RESPONSE, Returned by Handler for=20 [EmbeddedControl] (20100915/evregion-588) ACPI Error: Method parse/execution failed [\\_SB_.BAT0._STA] (Node=20 0xc4328520), AE_NO_HARDWARE_RESPONSE (20100915/psparse-633) ACPI Error: Method execution failed [\\_SB_.BAT0._STA] (Node 0xc4328520),=20 AE_NO_HARDWARE_RESPONSE (20100915/uteval-185) acpi_ec0: EcRead: failed waiting to get data ACPI Exception: AE_NO_HARDWARE_RESPONSE, Returned by Handler for=20 [EmbeddedControl] (20100915/evregion-588) ACPI Error: Method parse/execution failed [\\_SB_.BAT0._STA] (Node=20 0xc4328520), AE_NO_HARDWARE_RESPONSE (20100915/psparse-633) ACPI Error: Method execution failed [\\_SB_.BAT0._STA] (Node 0xc4328520),=20 AE_NO_HARDWARE_RESPONSE (20100915/uteval-185) acpi_ec0: EcRead: failed waiting to get data ACPI Exception: AE_NO_HARDWARE_RESPONSE, Returned by Handler for=20 [EmbeddedControl] (20100915/evregion-588) ACPI Error: Method parse/execution failed [\\_SB_.BAT0._BST] (Node=20 0xc43284e0), AE_NO_HARDWARE_RESPONSE (20100915/psparse-633) acpi_ec0: EcRead: failed waiting to get data ACPI Exception: AE_NO_HARDWARE_RESPONSE, Returned by Handler for=20 [EmbeddedControl] (20100915/evregion-588) ACPI Error: Method parse/execution failed [\\_TZ_.TZ00._TMP] (Node=20 0xc4328b80), AE_NO_HARDWARE_RESPONSE (20100915/psparse-633) The messages are not always consistent; sometimes they occur during boot. = =20 Also sometimes the EC fails to powerdown the computer. =20 > I also looked at your changes and at what Linux does and came up with some > changes to make our EC code more robust. They are significantly based on > your patch, but also add some additional logic from Linux code. >=20 > Can you try the patch? > http://people.freebsd.org/~avg/acpi_ec.patch > Thanks a lot! Two notes about your patch: - EcCheckStatus has changed position in the file resulting in a larger tha= n=20 required change. =20 - You no longer dynamically switch to polled mode. Was that intentional? Your patchs works. No errors were reported during the stress test, however= =20 running acpiconf takes a noticeably longer time to complete (before and wit= h=20 my patch it was instantaneous). Setting debug.acpi.ec.timeout=3D25 improve= s=20 responsiveness (reducing to 5 resulting in GPE query failed messages). =20 Accoring to time acpiconf takes upto 3 seconds to complete, after setting=20 debug.acpi.ec.timeout it takes upto 0.24 seconds. =20 I changed EC_POLL_DELAY back to 5 and that didn't change anything. =20 > P.S. I can describe why I didn't include some parts of your changes and > what new changes I made and "borrowed" from Linux, but later, if you'd > like. --nextPart3785335.Aben0vuXi3 Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (FreeBSD) iEYEABECAAYFAkyrZkoACgkQUaaFgP9pFrJNvgCfTh+WLv+e8iUj45svPg39is4L EdgAoI72O51NeYgANB03UpwXC70L9gFg =nPj/ -----END PGP SIGNATURE----- --nextPart3785335.Aben0vuXi3--