From owner-freebsd-bugs Thu Oct 18 5:40:13 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 7293937B403 for ; Thu, 18 Oct 2001 05:40:01 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.4/8.11.4) id f9ICe1s82228; Thu, 18 Oct 2001 05:40:01 -0700 (PDT) (envelope-from gnats) Received: from rcpt-expgw.biglobe.ne.jp (rcpt-expgw.biglobe.ne.jp [210.147.6.216]) by hub.freebsd.org (Postfix) with ESMTP id 4623D37B405 for ; Thu, 18 Oct 2001 05:36:48 -0700 (PDT) Received: from smtp-gw.biglobe.ne.jp by rcpt-expgw.biglobe.ne.jp (8.9.3+3.2W/3.7W-01101108) with ESMTP id VAA23224 for ; Thu, 18 Oct 2001 21:36:52 +0900 (JST) Received: from server.localdomain (202.225.211.7 [202.225.211.7]) by smtp-gw.biglobe.ne.jp id VACVC0A8274B; Thu, 18 Oct 2001 21:36:46 +0900 (JST) Message-Id: <20011018213646.VACVC0A8274B.C77F0C8A@mail.biglobe.ne.jp> Date: Thu, 18 Oct 2001 21:36:39 +0900 (JST) From: Koshin Sumitani Reply-To: "K.Sumitani" To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.113 Subject: i386/31353: 'shutdown -p' does not work on SMP Tyan Tiger100 Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 31353 >Category: i386 >Synopsis: 'shutdown -p' does not work on SMP Tyan Tiger100 >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Oct 18 05:40:01 PDT 2001 >Closed-Date: >Last-Modified: >Originator: Koshin Sumitani >Release: FreeBSD 4.4-RELEASE i386 >Organization: >Environment: System: FreeBSD server.localdomain 4.4-RELEASE FreeBSD 4.4-RELEASE #3: Wed Oct 17 18:56:30 JST 2001 sumitani@server.localdomain:/work4/src-4.4/sys/compile/Server i386 >Description: Tyan Tiger100's APM-BIOS does not work and return immediately if called from CPU#1. If called from CPU#0, it works. So, 'shutdown -p' does not work. >How-To-Repeat: 'shutdown -p' on Dual-Processor Tyan Tiger100 >Fix: Here is a patch for /sys/i386/apm/apm.c I know that synchronize by smp_rendezvous() is not so good but it's for power-off... *** apm.c.orig Thu Oct 18 00:01:05 2001 --- apm.c Mon Oct 15 19:51:28 2001 *************** *** 281,299 **** * Turn off the entire system. */ static void ! apm_power_off(void *junk, int howto) { struct apm_softc *sc = &apm_softc; - /* Not halting powering off, or not active */ - if (!(howto & RB_POWEROFF) || !apm_softc.active) - return; sc->bios.r.eax = (APM_BIOS << 8) | APM_SETPWSTATE; sc->bios.r.ebx = PMDV_ALLDEV; sc->bios.r.ecx = PMST_OFF; sc->bios.r.edx = 0; (void) apm_bioscall(); } /* APM Battery low handler */ static void --- 281,326 ---- * Turn off the entire system. */ static void ! apm_do_power_off(void) { struct apm_softc *sc = &apm_softc; sc->bios.r.eax = (APM_BIOS << 8) | APM_SETPWSTATE; sc->bios.r.ebx = PMDV_ALLDEV; sc->bios.r.ecx = PMST_OFF; sc->bios.r.edx = 0; (void) apm_bioscall(); + + printf("power-off failed: returned from APM-BIOS\n"); + } + + #ifdef SMP + static void + apm_smp_power_off(void *arg) + { + if (cpuid != 0) { + for ( ; ; ) ; + } + apm_do_power_off(); + } + #endif + + static void + apm_power_off(void *junk, int howto) + { + + /* Not halting powering off, or not active */ + if (!(howto & RB_POWEROFF) || !apm_softc.active) + return; + + #ifdef SMP + smp_rendezvous( NULL, apm_smp_power_off, NULL, NULL ); + return; + #else + apm_do_power_off(); + #endif } + /* APM Battery low handler */ static void >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message