Date: Thu, 18 Oct 2001 21:36:39 +0900 (JST) From: Koshin Sumitani <ksumitani@mui.biglobe.ne.jp> To: FreeBSD-gnats-submit@freebsd.org Subject: i386/31353: 'shutdown -p' does not work on SMP Tyan Tiger100 Message-ID: <20011018213646.VACVC0A8274B.C77F0C8A@mail.biglobe.ne.jp>
next in thread | raw e-mail | index | archive | help
>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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20011018213646.VACVC0A8274B.C77F0C8A>