Re: [PATCH] dwc3: gadget: fix for no-resource condition in dwc3 device controller

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

 



hi,

Ravi Babu <ravibabu@xxxxxx> writes:
> The "no-resource" error occurs when the driver issues DEPSTRTXFER
> command to start data transfer on specific endpoint, and dwc3

this seems to imply that simply sending Start Transfer command would
trigger no-resource which is untrue. The error you mention happens when
there's a transfer ongoing and another Start Transfer is sent.

> core throws error "no resource" available to process the request.
>
> This condition is occurs in composite gadget scenario where there
> are multiple interfaces selected by host and during simulateneous
> data traffic on multiple endpoints on these interfaces, the issue

having several interfaces using different endpoints has no implication
into how Start Transfer command is sent, so this shouldn't happen. Are
you having issues with one particular interface, perhaps ?

> occur when software/driver issues DEPSTRTXFER command to specific
> endpoint in same direction (in/out) and other endpoint in the same
> direction (in/out) is busy or executed by dwc3 controller.

we have DWC3_EP_BUSY keeping track of that, I fail to see how you're
triggering this condition. Any logs available ? Also, which kernel are
you using to test this ? v4.4 ? v4.5-rc ?

> example: if dwc3 core is busy in transferring the request on ep1-in
> during this scenario, if software/driver queues another request on
> ep2-in and issue start transfer (DEPSTRTXFER command), then dwc3
> throws error "no-resource". The same applicable to OUT transfer.

this is wrong. EP1's resources are not related to EP2's resources. I
have feeling you haven't really understood the problem you're facing.

> The issue is root caused that software issue DEPSTARTCFG
> "START NEW CONFIGURATION" command twice during the SET_INTERFACE
> request received from host while selecting multiple interface.

which is expected. See commit aebda61871815 ("usb: dwc3: Reset the
transfer resource index on SET_INTERFACE"). In fact, this commit
regresses what previous commit fixed.

This is a clear NAK, sorry.

> In single configuration with two parallel interfaces, say the
> interface-1 has two endpoints, ep1-in & ep1-out, and interface-2
> has two endpoints ep2-in and ep2-out. The additional DEPSTARTCFG
> will make the core too allocate the same resource, say for ep2-in
> and ep2-out which were previously assigned to ep1-in and ep1-out.
>
> Therefore during the simulataneous traffic on endpoints on same
> direction leads to resource conflict and dwc3 core throws the
> "no-resource" error when DEPSTARTCFG command while issuing the
> start transfer request.
>
> Hence the DEPSTARTCFG must be issued only once after reset and
> during SET_CONFIG request from host to allocate the transfer
> resource properly for all endpoints on multiple interfaces in
> composite gadget scenario.

Did you read Synopsys databook ? Did you go through git log to see what
that particular line was added ?

> The issue is reproducible in composite gadget (ACM + NCM)
> enabled through CONFIGFS.

any scripts available to reproduce this with some recent kernel ?

If you can show a large trace output showing the error, that would be
great. In fact, if you could annotate it with what you think is wrong,
that would be even better ;-)

-- 
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