From owner-freebsd-mobile Sat Nov 1 10:27:52 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id KAA00604 for mobile-outgoing; Sat, 1 Nov 1997 10:27:52 -0800 (PST) (envelope-from owner-freebsd-mobile) Received: from ns.mt.sri.com (SRI-56K-FR.mt.net [206.127.65.42]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id KAA00599 for ; Sat, 1 Nov 1997 10:27:49 -0800 (PST) (envelope-from nate@rocky.mt.sri.com) Received: from rocky.mt.sri.com (rocky.mt.sri.com [206.127.76.100]) by ns.mt.sri.com (8.8.7/8.8.7) with ESMTP id LAA01916; Sat, 1 Nov 1997 11:27:47 -0700 (MST) Received: (from nate@localhost) by rocky.mt.sri.com (8.7.5/8.7.3) id LAA29865; Sat, 1 Nov 1997 11:27:46 -0700 (MST) Date: Sat, 1 Nov 1997 11:27:46 -0700 (MST) Message-Id: <199711011827.LAA29865@rocky.mt.sri.com> From: Nate Williams MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: mobile@freebsd.org, jdp@polstra.com Subject: Suspend failure error handling X-Mailer: VM 6.29 under 19.15 XEmacs Lucid Sender: owner-freebsd-mobile@freebsd.org X-Loop: FreeBSD.org Precedence: bulk As John noted earlier, if suspend fails (due to promiscous cards or whatever) the system is hosed up. Try this patch, which was much simpler to implement than I anticipated, and also hopefully works. Unfortunately, I don't have my laptop here, so I can't test it personally, but it's pretty basic. This patch should be applicable to both -current and -stable, since the code in both is pretty similar (I think???). # cd sys/i386/apm # patch < email # cd /sys/compile/KERNE # make && make install Nate ---------- Index: apm.c =================================================================== RCS file: /home/CVS/src/sys/i386/apm/apm.c,v retrieving revision 1.49 diff -b -u -r1.49 apm.c --- apm.c 1996/09/07 17:41:22 1.49 +++ apm.c 1997/11/01 18:24:16 @@ -397,13 +397,13 @@ { struct apm_softc *sc = &apm_softc; - if (!sc) - return; - - if (sc->initialized) { + if (sc && sc->initialized) { apm_execute_hook(hook[APM_HOOK_SUSPEND]); - apm_suspend_system(sc); + if (apm_suspend_system(sc) == 0) apm_processevent(sc); + else + /* Failed, resume everything */ + apm_execute_hook(hook[APM_HOOK_RESUME]); } } @@ -412,12 +412,8 @@ { struct apm_softc *sc = &apm_softc; - if (!sc) - return; - - if (sc->initialized) { + if (sc && sc->initialized) apm_execute_hook(hook[APM_HOOK_RESUME]); - } }