Subject: powering down pcmcia/cardbus slots
To: None <tech-kern@netbsd.org>
From: Steven M. Bellovin <smb@cs.columbia.edu>
List: tech-kern
Date: 02/16/2006 11:18:39
I have a card that, on removal, sometimes crashes my machine.  The card 
is an EVDO modem:

ohci0 at cardbus0 function 0: NEC USB Host Controller (rev. 0x43)
ohci0: interrupting at 11
ohci0: OHCI version 1.0
usb4 at ohci0: USB revision 1.0
uhub4 at usb4
uhub4: NEC OHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub4: 1 port with 1 removable, self powered
ohci1 at cardbus0 function 1: NEC USB Host Controller (rev. 0x43)
ohci1: interrupting at 11
ohci1: OHCI version 1.0
usb5 at ohci1: USB revision 1.0
uhub5 at usb5
uhub5: NEC OHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub5: 1 port with 1 removable, self powered
umodem0 at uhub4 port 1 configuration 1 interface 0
umodem0: Curitel Communications, Inc. Curitel Communications, Inc., rev 1.10/0.00, addr 2, iclass 2/2
umodem0: data interface 1, has CM over data, has break
umodem0: status change notification available
ucom0 at umodem0

I run ppp over it.  (That has its own set of problems, but they're not 
the point of this note.)

Anyway -- I of course kill pppd before removing the cards.  With 
moderate frequency, though -- say, about 10% of the time -- when I 
remove the card the laptop reboots.  As best I can tell, it's not going 
into ddb nor panicking, but since I've never seen any messages I can't 
be certain.  (Recently, I've started killing my Console window and 
switching to screen 1 before removing the card, to see if anything 
shows up.)  There definitely haven't been any dumps.  The question, 
then, is what would cause a machine to spontaneously reboot.

My current working hypothesis is that it's a power glitch.  I'd like to 
be able to power down the slot before removing the card.  If necessary, 
I'm willing to power it back up manually when inserting a card, though 
it would nicer if I didn't have to worry about that.

So -- how can this best be done?  (And does anyone have any better 
hypotheses about why the machine crashes?)

		--Steven M. Bellovin, http://www.cs.columbia.edu/~smb