Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 14 Jan 2008 11:11:48 -0800
From:      Nate Lawson <nate@root.org>
To:        stable@freebsd.org
Cc:        current@FreeBSD.org
Subject:   Re: Fix for GPE livelock on HPs
Message-ID:  <478BB3F4.7050600@root.org>
In-Reply-To: <4789B267.1000505@root.org>
References:  <47893F8B.7010805@root.org> <4789756B.8060203@vwsoft.com> <4789B267.1000505@root.org>

next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------070609030008030803090405
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

Nate Lawson wrote:
> Volker wrote:
>> On 12/23/-58 20:59, Nate Lawson wrote:
>>> I've committed the below patch and want to MFC it to 7.0.  To do this, I
>>> need people to test this quickly.  It probably has no effect in 6.x and
>>> probably doesn't apply cleanly there.
>>>
>>> Please try this patch if you have a laptop and 7.x.  If you have
>>> -current, just cvsup.  I'd like to make sure there is no regression.
>>> I'm already aware that it fixes things for some HP users.
>> Nate,
>>
>> can you be a bit specific for a) what GPE is, b) what the problem is,
>> c) what to look for (any test procedures?) and d) which HP laptop
>> models might be affected?
>>
>> I do have an Omnibook vt6200 (P-IV 1.8G) running 6-STABLE and a new HP
>> 6715b (Tur-X2 TL-60) running 7-RC1 (currently installing on this, OS
>> is not yet fully set up).
>>
>> If I knew what to look for, I might test your patches (at least on the
>>  7-RC1 version).
> 
> A GPE is an interrupt of sorts.  I'm looking for any bad behavior the
> patch might cause.  I'm certain it fixes lockups some HPs had during
> thermal zone events (i.e. fan switching on when it gets hot).  Pretty
> much anyone with a laptop that locks up and you suspect acpi should test
> it.  And anyone who is willing to test it on another brand laptop to be
> sure the patch doesn't break anything more would be welcome.
> 
> You should be able to do "sysctl hw.acpi" and see the temperature and
> "apm" to see battery status without any new problems after applying the
> patch.

I've added a patch for 6-stable also (attached).  Please test if you
have a laptop and 6.x.  See -current for the 7.x patch if that's
relevant to you.

-Nate

--------------070609030008030803090405
Content-Type: text/x-patch;
 name="defer_gpe_6x.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="defer_gpe_6x.diff"

Index: sys/dev/acpica/Osd/OsdSchedule.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/acpica/Osd/OsdSchedule.c,v
retrieving revision 1.32.2.6
diff -u -r1.32.2.6 OsdSchedule.c
--- sys/dev/acpica/Osd/OsdSchedule.c	6 Jul 2006 08:32:49 -0000	1.32.2.6
+++ sys/dev/acpica/Osd/OsdSchedule.c	14 Jan 2008 19:06:27 -0000
@@ -106,10 +106,8 @@
     at->at_context = Context;
     switch (Priority) {
     case OSD_PRIORITY_GPE:
-	pri = 4;
-	break;
     case OSD_PRIORITY_HIGH:
-	pri = 3;
+	pri = 4;
 	break;
     case OSD_PRIORITY_MED:
 	pri = 2;
Index: sys/contrib/dev/acpica/evgpe.c
===================================================================
RCS file: /home/ncvs/src/sys/contrib/dev/acpica/evgpe.c,v
retrieving revision 1.1.1.9.2.1
diff -u -r1.1.1.9.2.1 evgpe.c
--- sys/contrib/dev/acpica/evgpe.c	7 Nov 2005 09:55:48 -0000	1.1.1.9.2.1
+++ sys/contrib/dev/acpica/evgpe.c	14 Jan 2008 19:02:15 -0000
@@ -587,6 +587,10 @@
  *
  ******************************************************************************/
 
+static void
+AcpiEvAsynchEnableGpe (
+    void                    *Context);
+
 static void ACPI_SYSTEM_XFACE
 AcpiEvAsynchExecuteGpeMethod (
     void                    *Context)
@@ -656,13 +660,26 @@
         }
     }
 
-    if ((LocalGpeEventInfo.Flags & ACPI_GPE_XRUPT_TYPE_MASK) == ACPI_GPE_LEVEL_TRIGGERED)
+    /* Defer enabling of GPE until all notify handlers are done */
+    AcpiOsExecute(OSL_NOTIFY_HANDLER, AcpiEvAsynchEnableGpe, GpeEventInfo);
+    return_VOID;
+}
+
+static void
+AcpiEvAsynchEnableGpe (
+    void                    *Context)
+{
+    ACPI_GPE_EVENT_INFO     *GpeEventInfo = (void *) Context;
+    ACPI_STATUS             Status;
+
+    if ((GpeEventInfo->Flags & ACPI_GPE_XRUPT_TYPE_MASK) ==
+            ACPI_GPE_LEVEL_TRIGGERED)
     {
         /*
          * GPE is level-triggered, we clear the GPE status bit after
          * handling the event.
          */
-        Status = AcpiHwClearGpe (&LocalGpeEventInfo);
+        Status = AcpiHwClearGpe (GpeEventInfo);
         if (ACPI_FAILURE (Status))
         {
             return_VOID;
@@ -671,7 +688,7 @@
 
     /* Enable this GPE */
 
-    (void) AcpiHwWriteGpeEnableReg (&LocalGpeEventInfo);
+    (void) AcpiHwWriteGpeEnableReg (GpeEventInfo);
     return_VOID;
 }
 

--------------070609030008030803090405--



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