hotplug remove vs. device driver close
Benjamin Herrenschmidt
benh at kernel.crashing.org
Fri Jun 4 13:58:23 EST 2004
On Fri, 2004-06-04 at 05:39, linas at austin.ibm.com wrote:
> On Thu, Jun 03, 2004 at 12:23:04PM -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().
I think the problem is more specific to the netdev interface no ? Isn't
it just that unregister_netdevice fails when it's open ? In which case,
remove should fail ... which may not be what you want, but I don't see
a proper solution unless we fix the network core.
Hrm... looking at the code, unregister_netdevice is supposed to do
a close... Maybe something isn't working properly there...
Ben.
** Sent via the linuxppc64-dev mail list. See http://lists.linuxppc.org/
More information about the Linuxppc64-dev
mailing list