summaryrefslogtreecommitdiffstats
path: root/drivers/usb/dwc3
diff options
context:
space:
mode:
authorFelipe Balbi <felipe.balbi@linux.intel.com>2019-01-21 13:00:03 +0200
committerFelipe Balbi <felipe.balbi@linux.intel.com>2019-02-04 08:45:56 +0200
commit974a1368c33ebb09c94c9ec1b523908cc7ca068f (patch)
tree8cdb27b8fec0f6dd1abfdf4e6b9601e918ae955a /drivers/usb/dwc3
parentacbfa6c26f21a18830ee064b588c92334305b6af (diff)
downloadlinux-974a1368c33ebb09c94c9ec1b523908cc7ca068f.tar.bz2
usb: dwc3: gadget: don't use resource_index as a flag
We have a proper flag for testing that we have a valid transfer in flight, let's use that instead. This patch is in preparation to fix a rare race condition that happens upon Disconnect Interrupt. Tested-by: Thinh Nguyen <thinhn@synopsys.com> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Diffstat (limited to 'drivers/usb/dwc3')
-rw-r--r--drivers/usb/dwc3/gadget.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index f9b44302199a..eaeea8ff5191 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -2626,8 +2626,8 @@ static void dwc3_stop_active_transfer(struct dwc3_ep *dep, bool force)
u32 cmd;
int ret;
- if ((dep->flags & DWC3_EP_END_TRANSFER_PENDING) ||
- !dep->resource_index)
+ if ((dep->flags & DWC3_EP_END_TRANSFER_PENDING)
+ || !(dep->flags & DWC3_EP_TRANSFER_STARTED))
return;
/*