Alan Stern wrote: > > When an URB is unlinked, and it is for a full-speed/low-speed device > attached via a high-speed hub, it is necessary to send a > Clear-TT-Buffer request to the hub. The usbmon log did not show any > such requests being sent. Without them, the TT buffers in the hub > never drain and it becomes impossible to send any more control or bulk > messages to that device (or to any other device sharing the same TT). > > Any high-speed host controller driver has to call > usb_hub_clear_tt_buffer() when a bulk or control URB going through a TT > is unlinked or fails for any reason other than -EPIPE or -EREMOTEIO. > Also, the driver must define a .clear_tt_buffer_complete callback in > its hc_driver structure, and it must not send any transactions to the > URB's endpoint until the callback tells it the TT buffer has been > cleared. > 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. 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)? (See http://lxr.linux.no/#linux+v2.6.39/drivers/usb/core/hub.c#L533.) -- Arvid Brodin Enea Services Stockholm AB -- 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