Comment 7 for bug 942120

Revision history for this message
In , Dave (dave-redhat-bugs) wrote :

I discussed this problem upstream with the USB maintainers.
Here's what Alan Stern replied:

I took a look at the source code for the hplip package. In
io/hpmud/musb.c, the musb_raw_channel_close() routine always calls
usb_clear_halt() for each bulk-in and bulk-out endpoint that it uses,
whether the endpoint needs it or not. If one of those endpoints had a
read or write going on in another thread at the same time, the
usb_clear_halt() call would cause the WARN to trigger.

It's hard to tell exactly what the program is doing. You'd think that
all I/O to a printer would be serialized, and ongoing reads or writes
would be completed before anything was closed. But the use of multiple
threads and callback routines makes the code difficult to follow.

Anyway, removing those usb_clear_halt() calls would most likely
eliminate the problem. Of course, they might be needed for some
printers. Still, it's best not to clear a halted endpoint until you
know that it is halted, and then it is best to clear the halt condition
right away instead of waiting until some I/O channel is closed.