Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 7 Jun 2006 15:24:04 -0400
From:      Jung-uk Kim <jkim@FreeBSD.org>
To:        Alexander Logvinov <abuse@akavia.ru>
Cc:        freebsd-acpi@FreeBSD.org, "Moore, Robert" <robert.moore@intel.com>
Subject:   Re: Re[2]: Machine did not reboot
Message-ID:  <200606071524.07284.jkim@FreeBSD.org>
In-Reply-To: <121000959.20060607154424@akavia.ru>
References:  <1182686709.20060605133201@akavia.ru> <200606062022.59336.jkim@FreeBSD.org> <121000959.20060607154424@akavia.ru>

next in thread | previous in thread | raw e-mail | index | archive | help

--Boundary-00=_XfyhEZz3nBeaHyx
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

On Wednesday 07 June 2006 01:44 am, Alexander Logvinov wrote:
> Hello.
>
> >> > > I had FreeBSD 5.4. After entering 'shutdown -r now' the
> >> > > system hanged on: 'Shutting down ACPI'
> >> > > 'Rebooting'
> >> > > but did not reboot.
> >> > > Upgraded to 6.1, it didn't help.
> >> > > hw.acpi.disable_on_poweroff="1" has no effect. What should I
> >> > > do?
> >> > > Motherboard: Chaintech 7VJL with latest BIOS.
> >> >
> >> > Try the reset_register method.  I have MFC'd the patch to
> >> > RELENG_6 so you can cvsup, recompile your acpi.ko, and test.
>
>  It doesn't help. Because acpi_shutdown_final in function goes to
>
>  else if (panicstr == NULL) {
>         printf("Shutting down ACPI\n");
>         AcpiTerminate();
>     }
>
>  and hangs up.
>
> >> RB_AUTOBOOT is defined as 0 in sys/reboot.h.  I don't think this
> >> test will ever work:
> >>       if ((howto & RB_AUTOBOOT) != 0 &&
> >> AcpiGbl_FADT->ResetRegSup) {
> >
> > It's little radical but what do you think about the attached
> > patch?  I don't think we have to call AcpiTerminate() to reboot
> > at all.  In fact, I have a box which does not reboot.  Writing
> > ACPI_DISABLE to SMI_CMD hangs the system and it does not support
> > RESET_REG. :-(  If I don't call AcpiTerminate(), everything's
> > fine.
>
>   I'll try this patch soon, thanks.

I don't know what ACPI spec. says (I guess I'll have to look it up) 
but Linux doesn't seem to use it except for ACPI init failure case.  
Now I have another evil hack (attached).  It will help rebooting 
without RESET_REG support and/or with broken BIOS.  Basically, it 
just bypasses AcpiDisable(), which may cause hang when ACPI_DISABLE 
through SMI_CMD is issued.

Thanks,

Jung-uk Kim

--Boundary-00=_XfyhEZz3nBeaHyx
Content-Type: text/plain;
  charset="iso-8859-1";
  name="acpi_shutdown.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename="acpi_shutdown.diff"

--- sys/dev/acpica/acpi.c	6 Jun 2006 18:30:38 -0000
+++ sys/dev/acpica/acpi.c	7 Jun 2006 19:08:27 -0000
@@ -240,6 +240,12 @@
 SYSCTL_INT(_debug_acpi, OID_AUTO, do_powerstate, CTLFLAG_RW,
     &acpi_do_powerstate, 1, "Turn off devices when suspending.");
 
+/* Disable ACPI when shutting down. */
+static int acpi_do_disable = 0;
+TUNABLE_INT("debug.acpi.do_disable", &acpi_do_disable);
+SYSCTL_INT(_debug_acpi, OID_AUTO, do_disable, CTLFLAG_RW,
+    &acpi_do_disable, 0, "Disable ACPI when shutting down.");
+
 /* Allow users to override quirks. */
 TUNABLE_INT("debug.acpi.quirks", &acpi_quirks);
 
@@ -1645,7 +1651,7 @@
 	    DELAY(1000000);
 	    printf("ACPI power-off failed - timeout\n");
 	}
-    } else if ((howto & RB_AUTOBOOT) != 0 && AcpiGbl_FADT->ResetRegSup) {
+    } else if ((howto & RB_HALT) == 0 && AcpiGbl_FADT->ResetRegSup) {
 	status = AcpiHwLowLevelWrite(
 	    AcpiGbl_FADT->ResetRegister.RegisterBitWidth,
 	    AcpiGbl_FADT->ResetValue, &AcpiGbl_FADT->ResetRegister);
@@ -1656,6 +1662,9 @@
 	    printf("ACPI reset failed - timeout\n");
 	}
     } else if (panicstr == NULL) {
+	/* XXX Evil hack to bypass AcpiDisable(). */
+	if (!acpi_do_disable)
+	    AcpiGbl_OriginalMode = ACPI_SYS_MODE_ACPI;
 	printf("Shutting down ACPI\n");
 	AcpiTerminate();
     }

--Boundary-00=_XfyhEZz3nBeaHyx--



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