From owner-freebsd-acpi@FreeBSD.ORG Wed Jun 7 00:41:20 2006 Return-Path: X-Original-To: freebsd-acpi@FreeBSD.org Delivered-To: freebsd-acpi@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0B9BB16A933 for ; Wed, 7 Jun 2006 00:23:33 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from anuket.mj.niksun.com (gwnew.niksun.com [65.115.46.162]) by mx1.FreeBSD.org (Postfix) with ESMTP id 666BA43D46 for ; Wed, 7 Jun 2006 00:23:32 +0000 (GMT) (envelope-from jkim@FreeBSD.org) Received: from niksun.com (anuket [10.70.0.5]) by anuket.mj.niksun.com (8.13.1/8.13.1) with ESMTP id k570NB2O074783; Tue, 6 Jun 2006 20:23:11 -0400 (EDT) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: Nate Lawson Date: Tue, 6 Jun 2006 20:22:57 -0400 User-Agent: KMail/1.6.2 References: <1182686709.20060605133201@akavia.ru> <44844D7E.50909@root.org> <200606061941.06244.jkim@FreeBSD.org> In-Reply-To: <200606061941.06244.jkim@FreeBSD.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: Multipart/Mixed; boundary="Boundary-00=_jxhhE/+KQrMaT0M" Message-Id: <200606062022.59336.jkim@FreeBSD.org> X-Virus-Scanned: ClamAV 0.88/1516/Tue Jun 6 18:45:31 2006 on anuket.mj.niksun.com X-Virus-Status: Clean Cc: freebsd-acpi@FreeBSD.org Subject: Re: Machine did not reboot X-BeenThere: freebsd-acpi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: ACPI and power management development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Jun 2006 00:41:21 -0000 --Boundary-00=_jxhhE/+KQrMaT0M Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline On Tuesday 06 June 2006 07:41 pm, Jung-uk Kim wrote: > On Monday 05 June 2006 11:27 am, Nate Lawson wrote: > > 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. > > Nate, > > 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. Thanks, Jung-uk Kim --Boundary-00=_jxhhE/+KQrMaT0M 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 00:12:12 -0000 @@ -240,6 +240,12 @@ SYSCTL_INT(_debug_acpi, OID_AUTO, do_powerstate, CTLFLAG_RW, &acpi_do_powerstate, 1, "Turn off devices when suspending."); +/* Terminate ACPI when shutting down. */ +static int acpi_shutdown_terminate = 1; +TUNABLE_INT("debug.acpi.shutdown_terminate", &acpi_shutdown_terminate); +SYSCTL_INT(_debug_acpi, OID_AUTO, shutdown_terminate, CTLFLAG_RW, + &acpi_shutdown_terminate, 1, "Terminate ACPI when shutting down."); + /* Allow users to override quirks. */ TUNABLE_INT("debug.acpi.quirks", &acpi_quirks); @@ -1645,7 +1651,12 @@ DELAY(1000000); printf("ACPI power-off failed - timeout\n"); } - } else if ((howto & RB_AUTOBOOT) != 0 && AcpiGbl_FADT->ResetRegSup) { + } else if ((howto & RB_HALT) != 0) { + if (panicstr == NULL && acpi_shutdown_terminate) { + printf("Shutting down ACPI\n"); + AcpiTerminate(); + } + } else if (AcpiGbl_FADT->ResetRegSup) { status = AcpiHwLowLevelWrite( AcpiGbl_FADT->ResetRegister.RegisterBitWidth, AcpiGbl_FADT->ResetValue, &AcpiGbl_FADT->ResetRegister); @@ -1655,9 +1666,6 @@ DELAY(1000000); printf("ACPI reset failed - timeout\n"); } - } else if (panicstr == NULL) { - printf("Shutting down ACPI\n"); - AcpiTerminate(); } } --Boundary-00=_jxhhE/+KQrMaT0M--