浏览代码

usb: dwc3: gadget: don't use resource_index as a flag

commit 974a1368c33ebb09c94c9ec1b523908cc7ca068f upstream.

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>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Felipe Balbi 6 年之前
父节点
当前提交
f1f67bc42b
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      drivers/usb/dwc3/gadget.c

+ 2 - 2
drivers/usb/dwc3/gadget.c

@@ -2461,8 +2461,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;
 
 	/*