Subject: Re: panic on suspend?
To: None <jmcneill@invisible.ca>
From: Takahiro Kambe <taca@back-street.net>
List: port-i386
Date: 09/08/2007 00:29:39
In message <20070906.211251.260796798.taca@back-street.net>
	on Thu, 06 Sep 2007 21:12:51 +0900 (JST),
	Takahiro Kambe <taca@back-street.net> wrote:
> > On Thu, 6 Sep 2007, Takahiro Kambe wrote:
> > > Recent current kernel panics when suspend.  Is there anyone see such a panic?
> > > (This isn't jmcneill-pm branch.)
> > 
> > Does the same happen on the branch?
> I don't test on jmcneill-pm branch.  Is there latest kernel of the branch?
It has the same branch.

As hinted with:
> Message-Id: <20070907143614.352C421507@cvs.netbsd.org>
> Subject: CVS commit: [jmcneill-pm] src/sys/dev/acpi
> Date: Fri,  7 Sep 2007 14:36:13 +0000 (UTC)
> From: Joerg Sonnenberger <joerg@netbsd.org>
> To: source-changes@NetBSD.org
> Reply-To: joerg@netbsd.org
> Precedence: list
> Delivered-To: source-changes@NetBSD.org
> X-Original-To: taca@back-street.net
> X-Original-To: source-changes@NetBSD.org
> 
> 
> Module Name:	src
> Committed By:	joerg
> Date:		Fri Sep  7 14:36:13 UTC 2007
> 
> Modified Files:
> 	src/sys/dev/acpi [jmcneill-pm]: acpi.c
> 
> Log Message:
> Expect acpi_md_sleep to protect itself against interrupts.
> This avoids DIAGNOSTIC assertions from within pmap.
This change make suspend/resume succeeded.  :-D

Index: sys/dev/acpi/acpi.c
===================================================================
RCS file: /data/cvs/src/sys/dev/acpi/acpi.c,v
retrieving revision 1.1.1.1.2.5
diff -p -u -r1.1.1.1.2.5 acpi.c
--- sys/dev/acpi/acpi.c	7 Sep 2007 15:10:20 -0000	1.1.1.1.2.5
+++ sys/dev/acpi/acpi.c	7 Sep 2007 15:28:39 -0000
@@ -1085,7 +1085,6 @@ is_available_state(struct acpi_softc *sc
 ACPI_STATUS
 acpi_enter_sleep_state(struct acpi_softc *sc, int state)
 {
-	int s;
 	ACPI_STATUS ret = AE_OK;
 
 	if (state == acpi_sleepstate)
@@ -1121,11 +1120,9 @@ acpi_enter_sleep_state(struct acpi_softc
 			 * support ACPI sleep state...
 			 */
 			dopowerhooks(PWR_SOFTSUSPEND);
-			s = splhigh();
 			dopowerhooks(PWR_SUSPEND);
 			acpi_md_sleep(state);
 			dopowerhooks(PWR_RESUME);
-			splx(s);
 			dopowerhooks(PWR_SOFTRESUME);
 			if (state==ACPI_STATE_S4)
 				AcpiEnable();


-- 
Takahiro Kambe <taca@back-street.net>