1 From db89960e50f45274c07dc60926b5a49489b8a7a0 Mon Sep 17 00:00:00 2001
2 From: Michael Grzeschik <m.grzeschik@pengutronix.de>
3 Date: Wed, 12 Sep 2012 14:58:04 +0300
4 Subject: usb: chipidea: udc: don't stall endpoint if request list is empty in isr_tr_complete_low
6 From: Michael Grzeschik <m.grzeschik@pengutronix.de>
8 commit db89960e50f45274c07dc60926b5a49489b8a7a0 upstream.
10 When attaching an imx28 or imx53 in USB gadget mode to a Windows host and
11 starting a rndis connection we see this message every 4-10 seconds:
13 g_ether gadget: high speed config #2: RNDIS
15 Analysis shows that each time this message is printed, the rndis connection is
16 re-establish due to a reset because of a stalled endpoint (ep 0, dir 1). The
17 endpoint is stalled because the reqeust complete bit on that endpoint is set,
18 but in isr_tr_complete_low() the endpoint request list (mEp->qh.queue) is
21 This patch removed this check, because the code doesn't take the following
22 situation into account:
24 The loop over all endpoints in isr_tr_complete_handler() will call ep_nuke() on
25 both ep0/dir0 and ep/dir1 in the first loop. Pending reqeusts will be flushed
26 and completed here. There seems to be a race condition, the request is nuked,
27 but the request complete bit will be set, too. The subsequent check (in
28 ep0/dir1's loop cycle) for endpoint request list (mEp->qh.queue) empty will
31 Both other mainline chipidea drivers (mv_udc_core.c and fsl_udc_core.c) don't
34 Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
35 Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
36 Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
37 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
40 drivers/usb/chipidea/udc.c | 5 +----
41 1 file changed, 1 insertion(+), 4 deletions(-)
43 --- a/drivers/usb/chipidea/udc.c
44 +++ b/drivers/usb/chipidea/udc.c
45 @@ -771,10 +771,7 @@ __acquires(mEp->lock)
47 struct ci13xxx_req *mReq, *mReqTemp;
48 struct ci13xxx_ep *mEpTemp = mEp;
49 - int uninitialized_var(retval);
51 - if (list_empty(&mEp->qh.queue))
55 list_for_each_entry_safe(mReq, mReqTemp, &mEp->qh.queue,