Re: [linux-usb-devel] 2.6.22-rc4-mm1

Alan Stern
2007-06-08T14:06:32Z

On Thu, 7 Jun 2007, Greg KH wrote:

> On Thu, Jun 07, 2007 at 10:53:29AM -0400, Alan Stern wrote:
> > To tell you the truth, I rather think there's not much point in keeping
> > usb-try-to-debug-bug-8561.patch around. Anything seriously wrong that
> > it could catch ought to have shown up long ago. And it is now clear
> > that bug 8561 has nothing to do with this; it is a programming error
> > common to many of the USB serial drivers. (Still waiting to hear back
> > from Paulo Pereira whether the fix to the USB Option driver works...)
>
> What error in the usb-serial drivers are you speaking about?

The one addressed by usb-option-fix-usage-of-urb-status-abuse.patch. I
thought it might be worthwhile to spend some time fixing all of these.
Here's a quick summary showing the extent of the problem (note that
not all the usages are in error):

$ grep EINPROGRESS drivers/usb/serial/*.c drivers/usb/misc/*.c
drivers/usb/serial/digi_acceleport.c:* return 256 when -EINPROGRESS is set, as the line discipline
drivers/usb/serial/digi_acceleport.c: while( oob_port->write_urb->status == -EINPROGRESS
drivers/usb/serial/digi_acceleport.c: while( (port->write_urb->status == -EINPROGRESS
drivers/usb/serial/digi_acceleport.c: while( oob_port->write_urb->status == -EINPROGRESS
drivers/usb/serial/digi_acceleport.c: if( port->write_urb->status == -EINPROGRESS
drivers/usb/serial/digi_acceleport.c: if( port->open_count && port->write_urb->status != -EINPROGRESS
drivers/usb/serial/digi_acceleport.c: if( port->write_urb->status == -EINPROGRESS
drivers/usb/serial/digi_acceleport.c: if( port->write_urb->status == -EINPROGRESS
drivers/usb/serial/empeg.c: if (write_urb_pool[i]->status != -EINPROGRESS) {
drivers/usb/serial/empeg.c: if (write_urb_pool[i]->status != -EINPROGRESS) {
drivers/usb/serial/empeg.c: if (write_urb_pool[i]->status == -EINPROGRESS) {
drivers/usb/serial/keyspan.c: if (this_urb->status == -EINPROGRESS) {
drivers/usb/serial/keyspan.c: } while (urb->status != -EINPROGRESS);
drivers/usb/serial/keyspan.c: if (this_urb->status != -EINPROGRESS)
drivers/usb/serial/keyspan.c: if (this_urb->status != -EINPROGRESS)
drivers/usb/serial/keyspan.c: if (urb && urb->status == -EINPROGRESS)
drivers/usb/serial/keyspan.c: /*while (p_priv->outcont_urb->status == -EINPROGRESS) {
drivers/usb/serial/keyspan.c: if (this_urb->status == -EINPROGRESS) {
drivers/usb/serial/keyspan.c: if (this_urb->status == -EINPROGRESS) {
drivers/usb/serial/keyspan.c: if (this_urb->status == -EINPROGRESS) {
drivers/usb/serial/keyspan.c: if (this_urb->status == -EINPROGRESS) {
drivers/usb/serial/keyspan.c: if (this_urb->status == -EINPROGRESS) {
drivers/usb/serial/keyspan_pda.c: * urb status is -EINPROGRESS, meaning it cannot write at the moment
drivers/usb/serial/keyspan_pda.c: again (the only sudden transition was the one from EINPROGRESS to
drivers/usb/serial/kl5kusb105.c: if (priv->write_urb_pool[i]->status != -EINPROGRESS) {
drivers/usb/serial/kl5kusb105.c: if (priv->write_urb_pool[i]->status == -EINPROGRESS) {
drivers/usb/serial/kl5kusb105.c: if (priv->write_urb_pool[i]->status != -EINPROGRESS) {
drivers/usb/serial/mos7720.c: if (port->read_urb->status != -EINPROGRESS) {
drivers/usb/serial/mos7720.c: if (mos7720_port->write_urb_pool[i] && mos7720_port->write_urb_pool[i]->status == -EINPROGRESS)
drivers/usb/serial/mos7720.c: if (mos7720_port->write_urb_pool[i] && mos7720_port->write_urb_pool[i]->status != -EINPROGRESS)
drivers/usb/serial/mos7720.c: if (mos7720_port->write_urb_pool[i] && mos7720_port->write_urb_pool[i]->status != -EINPROGRESS) {
drivers/usb/serial/mos7720.c: if (port->read_urb->status != -EINPROGRESS) {
drivers/usb/serial/mos7720.c: if(port->read_urb->status != -EINPROGRESS) {
drivers/usb/serial/mos7840.c: if (mos7840_port->read_urb->status != -EINPROGRESS) {
drivers/usb/serial/mos7840.c: if (mos7840_port->read_urb->status != -EINPROGRESS) {
drivers/usb/serial/sierra.c: if (this_urb->status == -EINPROGRESS) {
drivers/usb/serial/sierra.c: if (this_urb && this_urb->status != -EINPROGRESS)
drivers/usb/serial/sierra.c: if (this_urb && this_urb->status == -EINPROGRESS)
drivers/usb/misc/adutux.c: if (dev->interrupt_in_urb->status == -EINPROGRESS) {
drivers/usb/misc/adutux.c: if (should_submit && !dev->interrupt_in_urb->status==-EINPROGRESS) {
drivers/usb/misc/adutux.c: if (dev->interrupt_out_urb->status == -EINPROGRESS) {
drivers/usb/misc/auerswald.c: urb->status = -EINPROGRESS; /* usb_submit_urb does this, too */
drivers/usb/misc/auerswald.c: the result is 0 if the urb is cancelled, or -EINPROGRESS if
drivers/usb/misc/auerswald.c: if (urb->status != -EINPROGRESS) { /* No callback?!! */
drivers/usb/misc/auerswald.c:-EINPROGRESS during submission until end
drivers/usb/misc/usbtest.c: case -EINPROGRESS:
drivers/usb/misc/usbtest.c: if (!(retval == 0 || retval == -EINPROGRESS)) {

Alan Stern