소스 검색

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 <felipe.balbi@linux.intel.com>
Felipe Balbi 9 년 전
부모
커밋
58f29034b4
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      drivers/usb/dwc3/gadget.c

+ 2 - 1
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))