Re: [patch 02/03] USB: USB/IP: add client driver

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <greg@...>
Cc: <linux-usb@...>, <linux-kernel@...>, Brian Merrell <bgmerrell@...>, Takahiro Hirofuchi <hirofuchi@...>, <gregkh@...>
Date: Friday, August 29, 2008 - 12:02 pm

> +static int vhci_urb_enqueue(struct usb_hcd *hcd, struct urb *urb,

Neither of these two tests is necessary.  They are both carried out by
usb_hcd_link_urb_to_ep().


This is wrong.  The driver should simply return ret; it should not
giveback the URB.


It would be nice to avoid Japanese-isms in the comments.


Rather than deal with simulating initialization commands in difficult
contexts, it would be better to change usbcore.  We should recognize
the existence of "virtual" USB devices which don't need address
assignment or re-enumeration following reset.  Then much of the
following code wouldn't be needed.


While I don't fully grasp these comments, they don't seem entirely
right.  Maybe my understanding is just weak, though.

For example, there's never any need to notify that an unlink has 
completed.  In fact, unlinks don't complete at all -- URBs complete but 
unlinks don't.

Perhaps the trickiest part is what happens when you try to unlink 
before the submit request has been accepted by the server.  This could 
be handled in a couple of ways: The server could refuse the submit 
request, or the client could send the unlink message after the submit 
response is received.

But I don't see why the client would ever want to call 
usb_hcd_giveback_urb() from within the dequeue method.  Unless perhaps 
the URB is still on a submit queue, waiting to be sent to the server.


This test shouldn't be needed; the spinlock should prevent it from ever 
succeeding.


Don't return 0, return ret.


Why is this test repeated?  Couldn't the code be moved up into the 
previous test?


WHy is there special code for unlinking URBs after the TCP connection 
has gone down?  Shouldn't all outstanding URBs immediately complete 
with -ESHUTDOWN status?

Alan Stern

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[patch 00/03] USB-IP patches, , (Thu Aug 28, 7:00 pm)
Re: [patch 00/03] USB-IP patches, Brian G. Merrell, (Sat Aug 30, 1:50 am)
Re: [patch 00/03] USB-IP patches, Greg KH, (Tue Sep 2, 1:12 pm)
Re: [patch 00/03] USB-IP patches, Brian G. Merrell, (Tue Sep 23, 9:28 pm)
Re: [patch 00/03] USB-IP patches, Arnaldo Carvalho de Melo, (Thu Aug 28, 7:06 pm)
Re: [patch 03/03] USB: USB/IP: add host driver, Willy Tarreau, (Fri Aug 29, 1:43 am)
Re: [patch 02/03] USB: USB/IP: add client driver, Alan Stern, (Fri Aug 29, 12:02 pm)
Re: [patch 02/03] USB: USB/IP: add client driver, Oliver Neukum, (Fri Aug 29, 4:23 am)