On Tue, 19 Jul 2011, Arvid Brodin wrote: > I'm not comfortable with the usage of usb_hub_clear_tt_buffer(). The > function takes an urb as an argument (the urb that was involved in the > unlink or failed transaction) and may fail. This means that one have to > have a way of storing the offending urb and deferring calling > usb_hcd_giveback_urb() on it if the usb_hub_clear_tt_buffer() call fails. No, not really. If usb_hub_clear_tt_buffer() fails, you're stuck -- we don't have any way to recover. Hence there's no reason to store the offending URB or defer giving it back. Fortunately, the only failure mode is if there's not enough free memory to allocate a reasonably small data structure. > When looking at the code it isn't immediately obvious to me if one could > rewrite usb_hub_clear_tt_buffer() to take e.g. an endpoint as an argument > instead: > > (struct usb_host_endpoint *)->ep_dev contains a (struct usb_device *) > that might be the same as the urb->dev used in usb_hub_clear_tt_buffer(). > > I'm not sure how to get the pipe info needed without the urb though (is > it possible)? No, it isn't. But it doesn't matter; you can always give back the URB right after calling usb_hub_clear_tt_buffer(). Alan Stern -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html