Re: [PATCH] usb: gadget: ffs: Let setup() return USB_GADGET_DELAYED_STATUS

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

 



Hi,

Lars-Peter Clausen <lars@xxxxxxxxxx> writes:
>> Lars-Peter Clausen <lars@xxxxxxxxxx> writes:
>>> Some UDC drivers (like the DWC3) expect that the response to a setup()
>> 
>> not some, but *all*. You can only queue a response later IFF you return
>> USB_GADGET_DELAYED_STATUS.
>
> Yeah, but most drivers don't care. DWC3 is one of two which handles
> USB_GADGET_DELAYED_STATUS.

those drivers probably wouldn't work with g_mass_storage ;-)

>>> This fixed random occasional failures that were previously observed on a
>>> DWC3 based system under high system load.
>> 
>> I need to see tracepoint capture from the failure ;-) Care to send them
>> to me for analysis?
>
> I've attached the full trace up to the point where the failure occurs. (The
> tracing infrastructure in the DWC3 driver was very helpful in tracking this
> down btw.).

yeah, that was the idea. I see, however, that you're using an older
kernel based on the your trace format. Just to make sure, did you try
with v4.14? I see the problem is pretty clear and  we will take the
patch, but just to make sure, can you try v4.14?

> The important parts are around:
>
> 125.504109: dwc3_complete_trb: ep0out: ...
> 125.504111: dwc3_prepare_trb: ep0out: ...
>
> Then a few moments later
>
> 125.508529: dwc3_ep0: queueing request ffffffc8787b6d00 to ep0out ...
>
> Usually the queuing would happen before the dwc3_complete_trb and this
> function would remove the URB from the queue. But now it will just sit on

correct :-)

> the pending list waiting for something to happen since the original transfer
> is already over.
>
> When the next control request comes in and we try to queue something for EP0
> the 'list_empty(&dep->pending_list)' check will fail, we return an error and
> the endpoint is stalled and the host will observe an error.

right :-)

btw, you can enable only some events from dwc3 if you want. Usually I
enable all (echo 1 > /.../events/dwc3/enable) and disable read/writel
(echo 0 > /.../events/dwc3/dwc3_readl/enable && echo 0 >
/.../events/dwc3/dwc3_writel/enable), that helps a lot :-)

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