> Here is the good old bug which causes my Athlon to oops and lockup
> when I try to do 'cat large-file > /dev/usb/lp0' after turning my USB
> printer off. The oops seems to occur when the kernel figures out that
> the printer has been turned off. The bug also causes my system to
> freeze when I turn the printer off during a print job.
OK, please try this patch. Disclaimer: it compiles, I can't test it.
But it's modeled after the dc2xx code, which fixed identical "oops
on disconnect" behavior last summer (!).
What it does is mostly provide the necessary interlock (using a
binary semaphore === mutex) between the USB disconnect()
callback and the various chardev operations.
It also deletes some code from the "file close" path that should
only appear in the "device disconnect" path (it already did),
which could have caused oopses. And adds comments about
some remaining racey behavior.
- Dave
printer-0513.patch