[PATCH] parport fixes (2/6)
commit3833f137f9ebe3b9cfbfb026c53c5726d04cb485
authorAlexander Viro <viro@www.linux.org.uk>
Thu, 5 Feb 2004 00:58:49 +0000 (4 16:58 -0800)
committerLinus Torvalds <torvalds@home.osdl.org>
Thu, 5 Feb 2004 00:58:49 +0000 (4 16:58 -0800)
treef69d280c0b059f2ad460db3ad1f243d719bf2488
parent8d19538bd5e7aa71ff8dac5fbd272bdc17ad6311
[PATCH] parport fixes (2/6)

We use a new mutex to protect all additions/removals of drivers and
ports.  That cures a lot of insanity:
* driver removals can't hit us in the middle of attach_driver_chain().
Old code simply dies on that.
* port removals can't hit us in the middle of driver registration.
Again, old code dies on that.
* driver ->detach() is allowed to block now.
* we are guaranteed that by the time when parport_unregister_driver()
returns, all ->detach() calls are finished.  Old code did _not_ guarantee
that (read: was inherently racy since rmmod of driver could race with port
removal and get driver->detach(port) called after the module was gone).
* we are guaranteed that driver->attach(port) won't be called
more than once.  With the old code that was a matter of luck.
* removed piles and piles of braindead code.
drivers/parport/share.c