Hi Jacob,

On Thursday 20 August 2009 19:34:19 Jacob Fehr wrote:
> I have a UVC camera that will stall the control pipe when I try to access
> the extension unit. At first I thought this was a firmware issue because
> the kernel docs say that a device can't stall its control pipe. I did a
> little more digging and found that it isn't that absolute. The USB spec
> suggests that control pipe shouldn't but it can if it wants to raise a
> protocol error.

According to the USB 2.0 specification, section 8.5.3.4

"Control pipes have the unique ability to return a STALL handshake due to 
function problems in control transfers. If the device is unable to complete a 
command, it returns a STALL in the Data and/or Status stages of the control 
transfer. Unlike the case of a functional stall, protocol stall does not 
indicate an error with the device. The protocol STALL condition lasts until 
the receipt of the next SETUP transaction, and the function will return STALL 
in response to any IN or OUT transaction on the pipe until the SETUP 
transaction is received."

This means a device can respond with a STALL to a control transaction, but 
control pipes are supposed to recover from STALL conditions automatically. No 
CLEAR HALT request needs to be issued.

> I looked at the UVC source code in the kernel and found that it doesn't
> clear the stall when it gets EPIPE. I modified the UVC driver to call
> usb_clear_halt() after it gets EPIPE and this seems to resolve the issues
> that I had with my device.

It seems to be a very buggy device then ! If the default control endpoint gets 
halted for some reason (functional stall), it's supposed not to be able to 
communicate with the host anymore. In that case a CLEAR HALT request has no 
way of succeeding, as it can't be sent to the default control endpoint. Can 
you double-check your results ? What device are we talking about ?

> I'm thinking of submitting my fix back to the kernel maintainers but thought
> I'd post here first. Is there anything that I have overlooked?

-- 
Regards,

Laurent Pinchart
_______________________________________________
Linux-uvc-devel mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/linux-uvc-devel

Reply via email to