Re: [PATCH 1/2] usb: dwc3: gadget: set xfer resource per endpoint

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 6/2/2016 5:26 AM, Felipe Balbi wrote:
> 
> hi,
> 
> Felipe Balbi <felipe.balbi@xxxxxxxxxxxxxxx> writes:
>>> This reverts back to the original buggy behavior. This will fail when
>>> a SET_INTERFACE occurs multiple times.
>>>
>>> You can run testusb to see the failure:
>>> testusb -t 9 -c 5000 -s 2048 -a
>>
>> I came up with something else for this. It's still unstable and I need
>> to debug further to figure out where we're wrong. But it seems to me
>> that we're following databook down to the last comma with patch
>> below. Note that we're partially reverting your original changes and
>> adding some extra knowledge about current configuration and interface,
>> then we only reassign transfer resources if those change. Care to have a
>> look?
> 
> here's a version that passes testusb and normal enumeration with g_zero
> and g_mass_storage. After some experimenting, it seems like we should
> always MODIFY resource allocation, unless we're doing a SetConfiguration
> to the same configuration that is already chosen or a SetInterface to
> the same interface/alt-setting pair that's already being used. This is
> working for me. Can you test on your end too?

Hi Felipe,

You might be treading down a path we've already visited here :)

It looks like this patch will still fail the case with multiple
interfaces, with one or more having alt-settings. You will end up in a
situation where multiple endpoints are assigned the same transfer
resource which will cause failures.

Unfortunately I don't have an easy test outside of our test
environment that exposes this.

You could try creating a composite device. Interface #1 having a
single alt setting, interface #2 with multiple alt-settings. Start
traffic to both interfaces, then start setting different alt-settings
on interface #2.

The problem is the databook does not cover this condition. The
documentation will be fixed in 3.20a.

Ravi Babu originally reported this and you can see discussion in this
thread:

http://marc.info/?l=linux-usb&m=145396682025403&w=2

Regards,
John
--
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



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux