From mboxrd@z Thu Jan 1 00:00:00 1970 From: Greg KH Date: Thu, 03 Jun 2004 20:39:37 +0000 Subject: Re: hotplug remove vs. device driver close Message-Id: <20040603203937.GA25755@kroah.com> List-Id: References: <20040602181455.C17544@forte.austin.ibm.com> In-Reply-To: <20040602181455.C17544@forte.austin.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org On Thu, Jun 03, 2004 at 01:02:27PM -0700, Don Fry wrote: > > > > > > The pcnet32 driver tries to do the 'right thing' when it reads 0xffff, > > > but that does not include doing a 'close' prior to being removed. The > > > driver could keep some state around so that if its remove routine was > > > called without close first, it would cleanup, but I don't know of any > > > network driver that does this. > > > > What I get out of this thread is that pcnet32, and in fact, all drivers, > > should keep sufficient state around so that close() can be called either > > after or before remove(). > > > > Today in 2.6.6 if I try and do a rmmod pcnet32 and something is still using > the device, the rmmod will wait until the device is closed, and then it > goes away. Yes, that's a "feature" of the network stack :) > If the unplug does the same thing, and doesn't complete until the > close occurs, then I would not expect to leak anything, or crash > either. The device unplug knows nothing about the upper layers that the device might have attached to, sorry. thanks, greg k-h ------------------------------------------------------- This SF.Net email is sponsored by the new InstallShield X. >From Windows to Linux, servers to mobile, InstallShield X is the one installation-authoring solution that does it all. Learn more and evaluate today! http://www.installshield.com/Dev2Dev/0504 _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel