Date: Mon, 11 Jun 2007 09:16:08 +0200 From: Hans Petter Selasky <hselasky@c2i.net> To: freebsd-current@freebsd.org Cc: Warner Losh <imp@bsdimp.com>, current@freebsd.org, Pete Carah <pete@altadena.net> Subject: Re: panic when removing pccard Message-ID: <200706110916.08821.hselasky@c2i.net> In-Reply-To: <4669CCEC.2010901@altadena.net> References: <466913F0.2060200@cytexbg.com> <20070608.121532.1136082067.imp@bsdimp.com> <4669CCEC.2010901@altadena.net>
next in thread | previous in thread | raw e-mail | index | archive | help
On Friday 08 June 2007 23:41, Pete Carah wrote: > 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). BTW: If you stick with FreeBSD 6.2 then there should be less problems building newusb. > > 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). This is a known problem. > > > 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. You don't need interlayer messages. You just need a way to properly teardown the subdevices. And some sub-layers were not designed with detach in mind. With regard to "ucom", maybe it is an idea to look at the new "ucom" interface in the new USB stack? It is a complete rewrite, and it supports all kinds of USB serial devices. --HPS
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200706110916.08821.hselasky>