System hang on laptop suspend/resume

Stephen Casner casner at acm.org
Mon Jan 8 03:03:04 UTC 2007


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: <Cisco Systems 340 Series Wireless LAN Adapter> 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


More information about the freebsd-questions mailing list