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

    usb: dwc3: gadget: don't wrap around the TRB poll on non-ISOC

to the 3.3-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-wrap-around-the-trb-poll-on-non-isoc.patch
and it can be found in the queue-3.3 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <[email protected]> know about it.


>From 8d62cd65d74d0e241b3a152f7347bb66126b705b Mon Sep 17 00:00:00 2001
From: Paul Zimmerman <[email protected]>
Date: Wed, 15 Feb 2012 13:35:06 +0200
Subject: usb: dwc3: gadget: don't wrap around the TRB poll on non-ISOC

From: Paul Zimmerman <[email protected]>

commit 8d62cd65d74d0e241b3a152f7347bb66126b705b upstream.

If we have a non-ISOC endpoint, we will not have a Link TRB
pointing to the beginning of the TRB pool. On such endpoints,
we don't want to let the driver wrap around the TRB pool
otherwise controller will hang waiting for a valid TRB.

Signed-off-by: Paul Zimmerman <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

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

--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -667,6 +667,7 @@ static void dwc3_prepare_trbs(struct dwc
 {
        struct dwc3_request     *req, *n;
        u32                     trbs_left;
+       u32                     max;
        unsigned int            last_one = 0;
 
        BUILD_BUG_ON_NOT_POWER_OF_2(DWC3_TRB_NUM);
@@ -674,6 +675,13 @@ static void dwc3_prepare_trbs(struct dwc
        /* the first request must not be queued */
        trbs_left = (dep->busy_slot - dep->free_slot) & DWC3_TRB_MASK;
 
+       /* Can't wrap around on a non-isoc EP since there's no link TRB */
+       if (!usb_endpoint_xfer_isoc(dep->desc)) {
+               max = DWC3_TRB_NUM - (dep->free_slot & DWC3_TRB_MASK);
+               if (trbs_left > max)
+                       trbs_left = max;
+       }
+
        /*
         * if busy & slot are equal than it is either full or empty. If we are
         * starting to proceed requests then we are empty. Otherwise we ar


Patches currently in stable-queue which might be from [email protected] are

queue-3.3/usb-dwc3-fix-bogus-test-in-dwc3_gadget_start_isoc.patch
queue-3.3/usb-dwc3-gadget-don-t-wrap-around-the-trb-poll-on-non-isoc.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to