Machine did not reboot

Jung-uk Kim jkim at FreeBSD.org
Wed Jun 7 21:35:23 UTC 2006


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
-------------- next part --------------
--- 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();
     }


More information about the freebsd-acpi mailing list