]> git.karo-electronics.de Git - linux-beck.git/commitdiff
usb: dwc3: gadget: CSP is only valid for OUT endpoints
authorFelipe Balbi <felipe.balbi@linux.intel.com>
Thu, 6 Oct 2016 14:10:39 +0000 (17:10 +0300)
committerFelipe Balbi <felipe.balbi@linux.intel.com>
Thu, 3 Nov 2016 08:38:32 +0000 (10:38 +0200)
CSP bit is only valid for OUT endpoints. Synopsys
databook is unclear if HW ignores CSP for IN
endpoints (chances are, it does) but to avoid
problems, let's make sure to set CSP only when valid
to do so.

Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
drivers/usb/dwc3/gadget.c

index 2dfcbecec25cc7b3de131f4218e83089990e4229..270e837f16e0534f0b92eefabbc387492dc28b0c 100644 (file)
@@ -875,7 +875,8 @@ static void dwc3_prepare_one_trb(struct dwc3_ep *dep,
        }
 
        /* always enable Continue on Short Packet */
-       trb->ctrl |= DWC3_TRB_CTRL_CSP;
+       if (usb_endpoint_dir_out(dep->endpoint.desc))
+               trb->ctrl |= DWC3_TRB_CTRL_CSP;
 
        if ((!req->request.no_interrupt && !chain) ||
                        (dwc3_calc_trbs_left(dep) == 0))