Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 08 Jun 2007 17:41:00 -0400
From:      Pete Carah <pete@altadena.net>
To:        current@freebsd.org
Cc:        Warner Losh <imp@bsdimp.com>
Subject:   Re: panic when removing pccard
Message-ID:  <4669CCEC.2010901@altadena.net>
In-Reply-To: <20070608.121532.1136082067.imp@bsdimp.com>
References:  <466913F0.2060200@cytexbg.com> <20070608.121532.1136082067.imp@bsdimp.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Warner wrote:
> I'll take a look at this problem.  The one difference between what you
> are doing and what I do all the time is that you have devices plugged
> into your usb bus and I don't.  Given the name of the card, I suspect
> that's because they are soldered onto the usb bus.
> 
I see the same problem (in 6.x stable and 5.x stable; not using current 
lately) with a Verizon (audiovox) card; the Sierra 555 doesn't do it (no 
USB).  If I'm VERY careful stopping ppp (not pppd...) and waiting "long 
enough" sometimes it doesn't panic and sometimes it does.  I think the 
panic requires the serial sub-device to be open, and the teardown on 
unplugging the usb controller is in the wrong order. (the usb side 
doesn't check refcounts?)  Windoze handles this right, presumably by 
passing the disconnect message to the serial layer and waiting for it to 
clean up before disconnecting the usb.  This is mostly with the old usb 
stack; I used newusb for a while but managing cvsup+build was too much 
trouble...  Most of the cell-modems are fixed usb (indeed soldered in 
place).

Removing a umass before camcontrol eject acts (eject before umount 
panics later...) will sometimes (usually) do this too; it isn't just a 
serial-port (or soldered usb) problem.  Since umount wants to write in 
the normal case, one has to think carefully about what to do with the 
layering violation that results from disconnecting the usb.  (clearly 
will require fsck later in any event; it would be nice not to panic, 
though).

> We need to solve this problem for 7.0, I think.

Maybe even in 6.x.  Interlayer messaging would handle these disconnect 
situations easily but probably slows things down in the "normal" case.

> 
> Warner

-- Pete




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4669CCEC.2010901>