summaryrefslogtreecommitdiff
path: root/drivers/usb/atm/ueagle-atm.c
diff options
context:
space:
mode:
authorWesley Cheng <quic_wcheng@quicinc.com>2023-12-06 23:18:14 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-01-04 17:23:12 +0300
commit730e12fbec53ab59dd807d981a204258a4cfb29a (patch)
tree4e6c2586070da6dfbcf74b4b21a038834e547dad /drivers/usb/atm/ueagle-atm.c
parente7d3b9f28654dbfce7e09f8028210489adaf6a33 (diff)
downloadlinux-730e12fbec53ab59dd807d981a204258a4cfb29a.tar.xz
usb: dwc3: gadget: Handle EP0 request dequeuing properly
Current EP0 dequeue path will share the same as other EPs. However, there are some special considerations that need to be made for EP0 transfers: - EP0 transfers never transition into the started_list - EP0 only has one active request at a time In case there is a vendor specific control message for a function over USB FFS, then there is no guarantee on the timeline which the DATA/STATUS stage is responded to. While this occurs, any attempt to end transfers on non-control EPs will end up having the DWC3_EP_DELAY_STOP flag set, and defer issuing of the end transfer command. If the USB FFS application decides to timeout the control transfer, or if USB FFS AIO path exits, the USB FFS driver will issue a call to usb_ep_dequeue() for the ep0 request. In case of the AIO exit path, the AIO FS blocks until all pending USB requests utilizing the AIO path is completed. However, since the dequeue of ep0 req does not happen properly, all non-control EPs with the DWC3_EP_DELAY_STOP flag set will not be handled, and the AIO exit path will be stuck waiting for the USB FFS data endpoints to receive a completion callback. Fix is to utilize dwc3_ep0_reset_state() in the dequeue API to ensure EP0 is brought back to the SETUP state, and ensures that any deferred end transfer commands are handled. This also will end any active transfers on EP0, compared to the previous implementation which directly called giveback only. Fixes: fcd2def66392 ("usb: dwc3: gadget: Refactor dwc3_gadget_ep_dequeue") Cc: stable <stable@kernel.org> Signed-off-by: Wesley Cheng <quic_wcheng@quicinc.com> Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com> Link: https://lore.kernel.org/r/20231206201814.32664-1-quic_wcheng@quicinc.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/atm/ueagle-atm.c')
0 files changed, 0 insertions, 0 deletions