[ 3.5.yuz extended stable ] Patch "usb: dwc3: gadget: fix 'endpoint always busy' bug" has been added to staging queue

Herton Ronaldo Krzesinski herton.krzesinski at canonical.com
Wed Nov 21 05:08:49 UTC 2012

This is a note to let you know that I have just added a patch titled

    usb: dwc3: gadget: fix 'endpoint always busy' bug

to the linux-3.5.y-queue branch of the 3.5.yuz extended stable tree 
which can be found at:


If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.5.yuz tree, see



>From 5caadd9ba404f901f7343529263c6599ba8aa1a7 Mon Sep 17 00:00:00 2001
From: Felipe Balbi <balbi at ti.com>
Date: Thu, 4 Oct 2012 11:58:00 +0300
Subject: [PATCH] usb: dwc3: gadget: fix 'endpoint always busy' bug

commit 041d81f493d90c940ec41f0ec98bc7c4f2fba431 upstream.

If a USB transfer has already been started, meaning
we have already issued StartTransfer command to that
particular endpoint, DWC3_EP_BUSY flag has also
already been set.

When we try to cancel this transfer which is already
in controller's cache, we will not receive XferComplete
event and we must clear DWC3_EP_BUSY in order to allow
subsequent requests to be properly started.

The best place to clear that flag is right after issuing

Reported-by: Moiz Sonasath <m-sonasath at ti.com>
Signed-off-by: Felipe Balbi <balbi at ti.com>
Signed-off-by: Herton Ronaldo Krzesinski <herton.krzesinski at canonical.com>
 drivers/usb/dwc3/gadget.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index 0b24d9d..c7721db 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -1832,6 +1832,7 @@ static void dwc3_stop_active_transfer(struct dwc3 *dwc, u32 epnum)
 		ret = dwc3_send_gadget_ep_cmd(dwc, dep->number, cmd, &params);
 		dep->res_trans_idx = 0;
+		dep->flags &= ~DWC3_EP_BUSY;


More information about the kernel-team mailing list