From owner-freebsd-current@FreeBSD.ORG Mon Jun 11 07:16:17 2007 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F3A6816A469; Mon, 11 Jun 2007 07:16:16 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe04.swip.net [212.247.154.97]) by mx1.freebsd.org (Postfix) with ESMTP id 852C713C489; Mon, 11 Jun 2007 07:16:15 +0000 (UTC) (envelope-from hselasky@c2i.net) X-Cloudmark-Score: 0.000000 [] Received: from [194.248.135.20] (account mc467741@c2i.net HELO laptop.lan) by mailfe04.swip.net (CommuniGate Pro SMTP 5.1.9) with ESMTPA id 515202519; Mon, 11 Jun 2007 09:16:13 +0200 From: Hans Petter Selasky To: freebsd-current@freebsd.org Date: Mon, 11 Jun 2007 09:16:08 +0200 User-Agent: KMail/1.9.5 References: <466913F0.2060200@cytexbg.com> <20070608.121532.1136082067.imp@bsdimp.com> <4669CCEC.2010901@altadena.net> In-Reply-To: <4669CCEC.2010901@altadena.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200706110916.08821.hselasky@c2i.net> Cc: Warner Losh , current@freebsd.org, Pete Carah Subject: Re: panic when removing pccard X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jun 2007 07:16:17 -0000 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