stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Patch "usb: dwc3: gadget: don't clear EP_BUSY too early" has been added to the 4.1-stable tree
@ 2015-07-30  1:49 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2015-07-30  1:49 UTC (permalink / raw)
  To: balbi, gregkh, sundeep.lkml; +Cc: stable, stable-commits


This is a note to let you know that I've just added the patch titled

    usb: dwc3: gadget: don't clear EP_BUSY too early

to the 4.1-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     usb-dwc3-gadget-don-t-clear-ep_busy-too-early.patch
and it can be found in the queue-4.1 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From e18b7975c885bc3a938b9a76daf32957ea0235fa Mon Sep 17 00:00:00 2001
From: Felipe Balbi <balbi@ti.com>
Date: Fri, 29 May 2015 10:06:38 -0500
Subject: usb: dwc3: gadget: don't clear EP_BUSY too early

From: Felipe Balbi <balbi@ti.com>

commit e18b7975c885bc3a938b9a76daf32957ea0235fa upstream.

In case of non-Isochronous transfers, we don't
want to clear DWC3_EP_BUSY flag until XferComplete
event. That's because XferInProgress was only enabled
so we can recycle TRBs and usb_requests quicker, but
there are still other pending requests being transferred.

In order to make sure we don't allow for another StartTransfer
command while the HW is still processing other transfers,
we must keep DWC3_EP_BUSY flag set and this what this patch
does.

Fixes: f3af36511e60 (usb: dwc3: gadget: always enable IOC on
	bulk/interrupt transfers)
Reported-by: sundeep subbaraya <sundeep.lkml@gmail.com>
Tested-by: sundeep subbaraya <sundeep.lkml@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/usb/dwc3/gadget.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -1906,12 +1906,16 @@ static void dwc3_endpoint_transfer_compl
 {
 	unsigned		status = 0;
 	int			clean_busy;
+	u32			is_xfer_complete;
+
+	is_xfer_complete = (event->endpoint_event == DWC3_DEPEVT_XFERCOMPLETE);
 
 	if (event->status & DEPEVT_STATUS_BUSERR)
 		status = -ECONNRESET;
 
 	clean_busy = dwc3_cleanup_done_reqs(dwc, dep, event, status);
-	if (clean_busy)
+	if (clean_busy && (is_xfer_complete ||
+				usb_endpoint_xfer_isoc(dep->endpoint.desc)))
 		dep->flags &= ~DWC3_EP_BUSY;
 
 	/*


Patches currently in stable-queue which might be from balbi@ti.com are

queue-4.1/usb-f_mass_storage-limit-number-of-reported-luns.patch
queue-4.1/usb-dwc3-reset-the-transfer-resource-index-on-set_interface.patch
queue-4.1/usb-musb-host-rely-on-port_mode-to-call-musb_start.patch
queue-4.1/usb-gadget-mv_udc_core-fix-phy_regs-i-o-memory-leak.patch
queue-4.1/usb-dwc3-gadget-don-t-clear-ep_busy-too-early.patch
queue-4.1/usb-gadget-composite-fix-null-pointer-dereference.patch
queue-4.1/usb-dwc3-gadget-return-error-if-command-sent-to-depcmd-register-fails.patch
queue-4.1/usb-phy-mxs-suspend-to-ram-causes-null-pointer-dereference.patch
queue-4.1/usb-gadget-f_fs-do-not-set-cancel-function-on-synchronous-read-write.patch
queue-4.1/usb-dwc3-gadget-return-error-if-command-sent-to-dgcmd-register-fails.patch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-07-30  1:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-30  1:49 Patch "usb: dwc3: gadget: don't clear EP_BUSY too early" has been added to the 4.1-stable tree gregkh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).