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>
This commit is contained in:
Felipe Balbi 2019-01-21 13:00:03 +02:00
parent acbfa6c26f
commit 974a1368c3

View File

@ -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;
/*