Subject: kern/25811: acpi powerdown failure on VA1222
To: None <gnats-bugs@gnats.netbsd.org>
From: None <yamt@mwd.biglobe.ne.jp>
List: netbsd-bugs
Date: 06/04/2004 11:36:30
>Number:         25811
>Category:       kern
>Synopsis:       acpi powerdown failure on VA1222
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Jun 04 02:37:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator:     YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
>Release:        NetBSD 2.0F
>Organization:

>Environment:
	
	
System: NetBSD kaeru 2.0F NetBSD 2.0F (build.kaeru) #1372: Thu Jun 3 20:35:27 JST 2004 takashi@kaeru:/home/takashi/work/kernel/build.kaeru i386
Architecture: i386
Machine: i386
>Description:
	acpi power down fails on VA Linux 1222.
	VA Linux 1222 seems to be an OEM version of NEC Express 5800/120Ra-1.
	(i'm not sure about the NEC model name.)

	Linux 2.4.24 (acpica 20031002) has the problem.
	Linux 2.4.18 (acpica 20011018) works fine.

	if needed, i can provide dmesg, fadt, etc.
>How-To-Repeat:
	try poweroff(8) on the machine.
>Fix:
	the following is a workaround.
	- enable acpi unconditionally as old versions of acpica.
	  (the machine seems to have ACPI_BITREG_SCI_ENABLE set on boot.)
	- keep acpi enable on shutdown as linux.
	  (the machine won't power down after AcpiDisable.)

Index: acpi.c
===================================================================
--- acpi.c	(revision 727)
+++ acpi.c	(working copy)
@@ -146,8 +146,10 @@ static int acpi_locked;
 /*
  * Prototypes.
  */
+#if 0
 static void		acpi_shutdown(void *);
 static ACPI_STATUS	acpi_disable(struct acpi_softc *sc);
+#endif
 static void		acpi_build_tree(struct acpi_softc *);
 static ACPI_STATUS	acpi_make_devnode(ACPI_HANDLE, UINT32, void *, void **);
 
@@ -341,10 +343,12 @@ acpi_attach(struct device *parent, struc
 	 * events that might happen and confuse us while we're
 	 * trying to shut down.
 	 */
+#if 0
 	sc->sc_sdhook = shutdownhook_establish(acpi_shutdown, sc);
 	if (sc->sc_sdhook == NULL)
 		printf("%s: WARNING: unable to register shutdown hook\n",
 		    sc->sc_dev.dv_xname);
+#endif
 
 #ifdef ACPI_DEBUGGER
 	if (acpi_dbgr & ACPI_DBGR_RUNNING)
@@ -352,6 +356,7 @@ acpi_attach(struct device *parent, struc
 #endif
 }
 
+#if 0
 /*
  * acpi_shutdown:
  *
@@ -387,6 +392,7 @@ acpi_disable(struct acpi_softc *sc)
 	}
 	return rv;
 }
+#endif
 
 struct acpi_make_devnode_state {
 	struct acpi_softc *softc;
Index: acpica/Subsystem/evxfevnt.c
===================================================================
--- acpica/Subsystem/evxfevnt.c	(revision 571)
+++ acpica/Subsystem/evxfevnt.c	(working copy)
@@ -157,11 +157,13 @@ AcpiEnable (void)
         return_ACPI_STATUS (AE_NO_ACPI_TABLES);
     }
 
+#if 0
     if (AcpiHwGetMode() == ACPI_SYS_MODE_ACPI)
     {
         ACPI_DEBUG_PRINT ((ACPI_DB_INIT, "System is already in ACPI mode\n"));
     }
     else
+#endif
     {
         /* Transition to ACPI mode */
 
>Release-Note:
>Audit-Trail:
>Unformatted: