From owner-freebsd-current@FreeBSD.ORG Mon Jul 19 17:52:44 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D0A0916A4DA; Mon, 19 Jul 2004 17:52:43 +0000 (GMT) Received: from darkness.comp.waw.pl (darkness.comp.waw.pl [195.117.238.236]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6CBFC43D5A; Mon, 19 Jul 2004 17:52:43 +0000 (GMT) (envelope-from pjd@darkness.comp.waw.pl) Received: by darkness.comp.waw.pl (Postfix, from userid 1009) id E364EACAE6; Mon, 19 Jul 2004 19:52:41 +0200 (CEST) Date: Mon, 19 Jul 2004 19:52:41 +0200 From: Pawel Jakub Dawidek To: Scott Long Message-ID: <20040719175241.GJ57678@darkness.comp.waw.pl> References: <20040719145745.GH57678@darkness.comp.waw.pl> <20040719102139.N59702@carver.gumbysoft.com> <20040719173819.GI57678@darkness.comp.waw.pl> <40FC0832.3040805@freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="8tZVdKiiYitVG083" Content-Disposition: inline In-Reply-To: <40FC0832.3040805@freebsd.org> User-Agent: Mutt/1.4.2i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 5.2.1-RC2 i386 cc: freebsd-current@freebsd.org Subject: Re: Unloading USB driver while device is attached. X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 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, 19 Jul 2004 17:52:44 -0000 --8tZVdKiiYitVG083 Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jul 19, 2004 at 11:43:14AM -0600, Scott Long wrote: +> >Yeah, but even on 'kldunload -f' it should be possible to clean up +> >and avoid panic on next load. +> > +>=20 +> What usually happens in that a timeout happens and the driver handler no +> longer exists (i.e. forgot to call untimeout), or an interrupt happens +> and the driver forgot to deregister the interrupt. There are also a lot +> of rase possibilities in here even if the driver attempts to do the +> right thing. There really isn't a 'one size fits all' way to deal with +> this kind of thing. The driver author needs to build quiesce and +> shutdown semantics into the driver design. If your device is inserted and you load a driver everything is ok, because no driver is attached to this device. So, as I see it, device should be totally detached before unload and I susspect that something is missing in USB layer, not in all drivers. That's why when I load a driver again, USB thinks it is somehow connected to existing device, but it isn't. --=20 Pawel Jakub Dawidek http://www.FreeBSD.org pjd@FreeBSD.org http://garage.freebsd.pl FreeBSD committer Am I Evil? Yes, I Am! --8tZVdKiiYitVG083 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQFA/AppForvXbEpPzQRAqhHAJ0UJ+P6oFTC5Z8BoKp/ycG7HZlF3QCeL1Jj +1VQ4BxK1DlWDDDprEsOrCg= =7mHx -----END PGP SIGNATURE----- --8tZVdKiiYitVG083--