From 24823f1592d956b2a2dcfd6ac7d021af94d2f98c Mon Sep 17 00:00:00 2001 From: Rohith Kollalsi Date: Thu, 8 Apr 2021 16:49:44 +0530 Subject: [PATCH] usb: dwc3: gadget: Properly handle ClearFeature(halt) Commit 1bfa09147282 ("usb: dwc3: gadget: Properly handle ClearFeature(halt)") introduces stop active transfer to be done as a part of clear feature. But for gsi as a part of clear feature if stop active transfer is issued, as gsi uses hardware path for transfers it cannot issue start active transfer which leads to device sending not ready to the host while host trying to send data which inturn leads to rmnet call failure. Fix this by bailing out early without issuing stop active transfer in clear feature for the interfaces that use hardware path for transfers. Change-Id: I3929c610f50e6e5798517a03a9929db2824f87ff Signed-off-by: Rohith Kollalsi --- drivers/usb/dwc3/gadget.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index bfb0809be5cd..2fafcc244f66 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -1873,6 +1873,9 @@ int __dwc3_gadget_ep_set_halt(struct dwc3_ep *dep, int value, int protocol) dep->flags &= ~(DWC3_EP_STALL | DWC3_EP_WEDGE); + if (dep->gsi || dep->endless) + return 0; + dwc3_stop_active_transfer(dep, true, true); list_for_each_entry_safe(req, tmp, &dep->started_list, list)