From 58f29034b4c47b202f76de055f843316c8a9325f Mon Sep 17 00:00:00 2001 From: Felipe Balbi Date: Thu, 6 Oct 2016 17:10:39 +0300 Subject: [PATCH] usb: dwc3: gadget: CSP is only valid for OUT endpoints 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 --- drivers/usb/dwc3/gadget.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 2dfcbecec25c..270e837f16e0 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -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)) -- 2.20.1