Re: [PATCH v3] usb: mtu3: wait for TX FIFO to drain before disconnect

Marek Vasut via U-Boot <[email protected]>
Newsgroups org.u-boot-project.lists.u-boot
Message-ID <[email protected]>
On 7/20/26 10:03 AM, Carlo Caione wrote:
> Fastboot unregisters the USB gadget from the completion callback of
> its final OKAY response. MTU3 QMU can report that request complete
> while bytes remain in the endpoint TX FIFO. Disabling the USB function
> immediately can therefore disconnect the host before it receives the
> response.
> 
> Before selecting the high-speed or SuperSpeed disconnect operation, poll
> the FIFO state of enabled IN endpoints that have no pending requests.
> Bound the wait to 1 ms. If a FIFO does not drain, reset its endpoint,
> force the disconnect, and propagate -ETIMEDOUT through the gadget pullup
> operation. Endpoints with pending requests are skipped so an ordinary
> disconnect does not wait for an active transfer.
> 
> Fixes: e09b88cd083d ("usb: add MediaTek USB3 DRD driver")
> Signed-off-by: Vitor Sato Eschholz <[email protected]>
> Signed-off-by: Carlo Caione <[email protected]>

Reviewed-by: Marek Vasut <[email protected]>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.