On 27/04/2016 16:07, Mathias Nyman wrote:
> Hi
>
> On 26.04.2016 12:23, Julien D'ascenzio wrote:
>> Hi,
>>
>> I see you make this patch in the kernel mainline:
>>
>> xhci: Clear the ho27082e2654dc148078b0abdfc3c8e5ccbde0ebfa: st side:
>> toggle manually when endpoint is 'soft reset'
>>
>> then you revert it:
>>
>> d0167ad2954ee2d1c70704c454c646086b6653d6: Revert "xhci: Clear the host
>> side toggle manually when endpoint is 'soft reset'"
>>
>> This patch correct a problem I have with a camera (IDS US3 uEye CP). I
>> think, it's a similar problem as:
>> http://www.spinics.net/lists/linux-usb/msg132221.html
>>
>> Sometime, This error appear when I transfer a raw video with my camera :
>>
>> xhci-hcd xhci-hcd.6.auto: URB transfer length is wrong, xHC issue? req.
>> len = 0, act. len = 4294967288
>>
>> After that, the camera doesn't work and I must physically disconnect it
>>
>> You find attached to this email the usb camera trace (wireshark) when
>> this error occurs.
>> The transfer seems to start in packet number 21 (URB_CONTROL).
>> The error seems to occur after packet number 694 when a "CLEAR FEATURE"
>> is request.
>>
>> I'd like to know if you still work to a new patch to correct this? I
>> could help you to make some test with my hardware.
>>
>> Best regards
>>
>> Julien D'Ascenzio
>>
>
> I haven't been looking at this for a long time, so with the "xhci:
> Clear the host
> side toggle manually when endpoint is soft reset" patch everything works?
Yes, everything works thanks to this patch! I forgot to mention that I
currently worked on the
last kernel V4.6-rc5 for odroid-xu3
>
> Some additional questions.
> Are you using uvc or some custom usbfs with libusb implementation?
> If libusb is used, is there some extra libusb_clear_halt() used as a
> "soft reset"
> instead of actually clearing a halted endpoint?
Unfortunately, the driver to communicate with the camera is a
proprietary library...
Their code doesn't seem to use libusb. Their library and executable
don't have any trace of libusb.
They seem to use directly the device: "/dev/bus/usb/004/019" with their
own code.
This is the Device Descriptor of the camera (they don't seem to use UVC):
Bus 004 Device 019: ID 1409:3240 IDS Imaging Development Systems GmbH
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 3.00
bDeviceClass 255 Vendor Specific Class
bDeviceSubClass 255 Vendor Specific Subclass
bDeviceProtocol 255 Vendor Specific Protocol
bMaxPacketSize0 9
idVendor 0x1409 IDS Imaging Development Systems GmbH
idProduct 0x3240
bcdDevice 0.00
iManufacturer 1 Camera Manufacturer
iProduct 2 USB 3.0 Camera
iSerial 0
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 57
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0x80
(Bus Powered)
MaxPower 224mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 3
bInterfaceClass 255 Vendor Specific Class
bInterfaceSubClass 255 Vendor Specific Subclass
bInterfaceProtocol 255 Vendor Specific Protocol
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x82 EP 2 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0400 1x 1024 bytes
bInterval 0
bMaxBurst 15
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x01 EP 1 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0400 1x 1024 bytes
bInterval 0
bMaxBurst 15
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0400 1x 1024 bytes
bInterval 0
bMaxBurst 15
Binary Object Store Descriptor:
bLength 5
bDescriptorType 15
wTotalLength 22
bNumDeviceCaps 2
USB 2.0 Extension Device Capability:
bLength 7
bDescriptorType 16
bDevCapabilityType 2
bmAttributes 0x00000002
Link Power Management (LPM) Supported
SuperSpeed USB Device Capability:
bLength 10
bDescriptorType 16
bDevCapabilityType 3
bmAttributes 0x00
wSpeedsSupported 0x000c
Device can operate at High Speed (480Mbps)
Device can operate at SuperSpeed (5Gbps)
bFunctionalitySupport 2
Lowest fully-functional device speed is High Speed (480Mbps)
bU1DevExitLat 10 micro seconds
bU2DevExitLat 2047 micro seconds
Device Status: 0x0000
(Bus Powered)
>
> If the device endpoint is not actually halted then the clear halt
> request will
> clear the data toggle for the connected device, but the host will
> continue using
> the old toggle. -> out of sync.
>
> If endpoint is really halted then host will reset the host side
> endpoint together
> with a clear halt request to the device, and both toggles will be
> cleared.
>
> -Mathias
>
Thanks for the answer
Julien D'Ascenzio
N�����r��y����b�X��ǧv�^�){.n�+����{������^n�r���z���h�����&���G���h�(�階�ݢj"���m������z�ޖ���f���h���~�m�