Re: [PATCH v3] usb: dwc3: Fix assignment of EP transfer resources

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

 



Hi,

John Youn <John.Youn@xxxxxxxxxxxx> writes:
>>> +static int dwc3_gadget_set_xfer_resource(struct dwc3 *dwc, struct dwc3_ep *dep);
>>> +
>>> +/**
>>> + * dwc3_gadget_start_config - Configure EP resources
>>> + * @dwc: pointer to our controller context structure
>>> + * @dep: endpoint that is being enabled
>>> + *
>>> + * The assignment of transfer resources cannot perfectly follow the
>>> + * data book due to the fact that the controller driver does not have
>>> + * all knowledge of the configuration in advance. It is given this
>>> + * information piecemeal by the composite gadget framework after every
>>> + * SET_CONFIGURATION and SET_INTERFACE. Trying to follow the databook
>>> + * programming model in this scenario can cause errors. For two
>>> + * reasons:
>>> + *
>>> + * 1) The databook says to do DEPSTARTCFG for every SET_CONFIGURATION
>>> + * and SET_INTERFACE (8.1.5). This is incorrect in the scenario of
>>> + * multiple interfaces.
>>> + *
>>> + * 2) The databook does not mention doing more DEPXFERCFG for new
>>> + * endpoint on alt setting (8.1.6).
>>> + *
>>> + * The following simplified method is used instead:
>>> + *
>>> + * All hardware endpoints can be assigned a transfer resource and this
>>> + * setting will stay persistent until either a core reset or
>>> + * hibernation. So whenever we do a DEPSTARTCFG(0) we can go ahead and
>>> + * do DEPXFERCFG for every hardware endpoint as well. We are
>>> + * guaranteed that there are as many transfer resources as endpoints.
>>> + *
>> 
>> The databook says the resource is released after transfer completion
>> event on ep, in this case whether resource is still valid which was
>> pre-allocated to all eps during initial setup?

that only means you can send another Start Transfer command, instead of
Update Transfer.

> The resource is released in the sense that it is not actively being
> used. The same resource is still assigned to the hw endpoint and will
> be re-used when a start transfer happens.
>
> Theoretically, when a resource is not being used it could be used by
> another endpoint or reassigned, but in practice there is no need to do
> any of this shuffling as there are always as many resources as
> endpoints.
>
>> If the core is designed to reuse of unused ep's resources, whether is
>> there any performance impact by core due resource pre-allocated for
>> eps ?  Please confirm with IP folks as well.

we cannot (or rather, will not) try to figure out how to use more than
one transfer resource per endpoint. We have never done it and will not
start attempting now.

Do you have performance limitations with current driver ? Last time I
measured USB2 and USB3 on a TI platform, numbers were quite good.

USB2 gave me almost 40MiB/sec on mass storage, while USB3 gave me around
130MiB/sec. Let us know if these numbers are not enough, but at least
for USB2, we're pretty much maxing out what USB2 can do.

> I check with IP team. There is no performance impact. It is the same
> as if you never used those endpoints.

I wouldn't bother checking. It's an academic (and quite useless one)
discussion anyway. SNPS has never said that one endpoint could use more
than one transfer resource.

-- 
balbi

Attachment: signature.asc
Description: PGP signature


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

  Powered by Linux