From owner-freebsd-new-bus Fri Dec 3 13: 4:56 1999 Delivered-To: freebsd-new-bus@freebsd.org Received: from ns.skylink.it (ns.skylink.it [194.177.113.1]) by hub.freebsd.org (Postfix) with ESMTP id D9D50153E0 for ; Fri, 3 Dec 1999 13:04:45 -0800 (PST) (envelope-from hibma@skylink.it) Received: from skylink.it (va-154.skylink.it [194.185.55.154]) by ns.skylink.it (8.9.1/8.8.8) with ESMTP id WAA09981; Fri, 3 Dec 1999 22:04:43 +0100 Received: from localhost (localhost [127.0.0.1]) by skylink.it (8.9.3/8.9.3) with ESMTP id PAA00323; Fri, 3 Dec 1999 15:46:45 +0100 (CET) (envelope-from hibma@skylink.it) Date: Fri, 3 Dec 1999 15:46:45 +0100 (CET) From: Nick Hibma X-Sender: n_hibma@henny.jrc.it Reply-To: Nick Hibma To: Doug Rabson Cc: FreeBSD Newbus Mailing List Subject: Re: PCCARD eject freeze (was Re: your mail) In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-new-bus@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > > DEVICE_DETACH called from device_delete_child wakes up all the sleepers > > and exits. The sleepers actually start running after DEVICE_DETACH has > > finished and the softc has been blown away by the device_delete_child > > that followed. > > > > I think this cries for a loop: Call detach and if EAGAIN is returned > > make sure sleepers can wake up and exit, and then try again. > > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > I have no idea how this 'wait for sleepers to have run' could be > > implemented, but this is I think the crucial part. > > I think that the solution is probably to use the busy counter more > effectively. No, as the device is gone and the driver should detach from it. What other mechanism is there to let the driver know that the physical device is gone? We can either solve this in a generic fashion or otherwise people will do things like, call detach and remember that it was called, then start detaching and, after finishing, the driver detaches itself with DEVICE_DETACH. It gets messy. I prefer a generic mechanism to let the driver know that it should go away and a detach method to make it go away now. Or the EAGAIN solution given above. Nick -- hibma@skylink.it n_hibma@freebsd.org USB project http://www.etla.net/~n_hibma/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-new-bus" in the body of the message