From owner-freebsd-stable@FreeBSD.ORG Tue Jan 23 07:58:42 2007 Return-Path: X-Original-To: freebsd-stable@freebsd.org Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 92DF516A401 for ; Tue, 23 Jan 2007 07:58:42 +0000 (UTC) (envelope-from casner@acm.org) Received: from mailman.packetdesign.com (dns.packetdesign.com [65.192.41.10]) by mx1.freebsd.org (Postfix) with ESMTP id 81CA213C428 for ; Tue, 23 Jan 2007 07:58:42 +0000 (UTC) (envelope-from casner@acm.org) Received: from packetdesign.com (main-fw-eth1.packetdesign.com [192.168.0.254]) by mailman.packetdesign.com (8.13.1/8.13.1) with ESMTP id l0N7weN6006491; Mon, 22 Jan 2007 23:58:40 -0800 Date: Tue, 23 Jan 2007 00:15:39 -0800 (PST) From: Stephen Casner Sender: casner@packetdesign.com To: freebsd-stable@freebsd.org Message-ID: <20070123001343.J641@oak.packetdesign.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Subject: System hang on laptop suspend/resume X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jan 2007 07:58:42 -0000 [Working my way up the food chain here after no response on freebsd-questions and freebsd-mobile. Please tell me if this question is ill-formed or if the answer is unlikely to be known.] I was running FreeBSD 4.8 on my Sony PCG-505TR laptop for about three years until I recently upgraded to 6.1 with a clean install on a new disk drive. One aspect of FreeBSD that I really liked was that suspend-to-memory and resume worked perfectly and quickly every time, whereas when I had previously tried this with Windows it usually failed. I did not even need to run apmd or configure any suspend or resume scripts other than the normal configuration in pccard.conf for the an0 802.11 network card. Sadly, with FreeBSD 6.1, the result is often a system hang requiring a power cycle to recover. I have found that I can avoid the hang if I do two things before suspend: - switch the display from X to the console vty (which I have automated using vidcontrol as suggested in the laptop article) - manually unplug the 802.11 network card and wait for dhclient to exit before suspending, and leave the card unplugged until after resuming My question is this: How can I programmatically power down or detach the network card? "ifconfig an0 down" is not sufficient. I'm worried about wearing out my PC Card slot by frequently unplugging the card. On 4.8, I used "pccardc power 0 0" to power down the card, but on 6.1 it results in the error message: pccardc: /dev/card0: No such file or directory In the mail archive, I saw that pccardc is not supported in NEWCARD, but the binary and man page are still included in the 6.1 release. Or is there something else I should be doing instead? Here are additional details -- - This laptop BIOS supports APM but not ACPI. - I am running apmd and have it configured to invoke rc.suspend and rc.resume, which in turn run vidcontrol. - I have two network cards: an0 and ath0. For an0, the hang occurs on resume about half the time. With ath0, it aways hangs. - The hang is indicated by a timeout on ad0 (see below). At that point, I can switch vtys among 1-8, but going to vty9 (X server) will hang. Ctrl-Alt-Delete does nothing. Return just echoes return, no login prompt (will echo more than once). - Pulling Aironet card and replugging results in: Interrupt storm detected on "irq9:"; throttling interrrupt source Messages on the console vty (manually copied): Dec 2 00:57:56 kao root: Received USERSUSPENDREQ Dec 2 00:57:56 kao apm: suspend an0: detached Dec 2 14:32:20 kao root: Received NORMRESUME Dec 2 14:32:20 kao apm: resumed from suspend Dec 2 14:32:20 kao dhclient[3365]: send_packet: Device not configured an0: at port 0x100-0x13f irq 9 function 0 config 5 on pccard0 an0: got RSSI <-> dBM map an0: supported rates: 1Mbps 2Mbps 5.5Mbps 11Mbps an0: Ethernet address: 00:40:96:32:05:b7 an0: [GIANT-LOCKED] ad0: TIMEOUT - READ_DMA retrying (1 retry left) LBA=68041200 Messages from /var/log/messages: Dec 2 00:57:56 kao apmd[412]: apmevent 000a index 7 Dec 2 00:57:56 kao root: Received USERSUSPENDREQ Dec 2 00:57:56 kao apm: suspend Dec 2 14:32:20 kao kernel: an0: detached Dec 2 14:32:20 kao kernel: wakeup from sleeping state (slept 13:34:17) Dec 2 14:32:19 kao apmd[412]: apmevent 0003 index 8 Dec 2 14:32:20 kao root: Received NORMRESUME Dec 2 14:32:20 kao apm: resumed from suspend Dec 2 14:32:20 kao dhclient[3365]: send_packet: Device not configured Dec 2 14:54:13 kao syslogd: kernel boot file is /boot/kernel/kernel Note that some log messages are written after resuming and before the hang, so ad0 is working up to the point where it gets the timeout. -- Steve