mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 11:50:43 +09:00
usb: dwc_otg_310: pcd: in ep do memory copy after alloc aligned buffer
If more than two consecutive requests queue into in ep, maybe some requests need alloc temporary aligned buffer, only the first request will do memory copy to the aligned buffer, but start_next_request() function missing memory copy, then the transmission of data will be wrong, so do memory copy after alloc aligned buffer right away. TEST=rk3288 use rndis gadget function, Linux PC use this command can't ping: ping IP -s 1473 Change-Id: I1c5339dbb089d8a94d8093baa2a801f54e450267 Signed-off-by: Feng Mingli <fml@rock-chips.com>
This commit is contained in:
@@ -2259,11 +2259,14 @@ int dwc_otg_pcd_ep_queue(dwc_otg_pcd_t *pcd, void *ep_handle,
|
||||
req->sent_zlp = zero;
|
||||
req->priv = req_handle;
|
||||
req->dw_align_buf = NULL;
|
||||
if ((dma_buf & 0x3) && GET_CORE_IF(pcd)->dma_enable
|
||||
&& !GET_CORE_IF(pcd)->dma_desc_enable)
|
||||
if ((dma_buf & 0x3) && GET_CORE_IF(pcd)->dma_enable &&
|
||||
!GET_CORE_IF(pcd)->dma_desc_enable) {
|
||||
req->dw_align_buf = DWC_DEV_DMA_ALLOC_ATOMIC(buflen,
|
||||
&req->
|
||||
dw_align_buf_dma);
|
||||
if (req->dw_align_buf && ep->dwc_ep.is_in)
|
||||
dwc_memcpy(req->dw_align_buf, buf, buflen);
|
||||
}
|
||||
DWC_SPINLOCK_IRQSAVE(pcd->lock, &flags);
|
||||
|
||||
/*
|
||||
@@ -2374,9 +2377,6 @@ int dwc_otg_pcd_ep_queue(dwc_otg_pcd_t *pcd, void *ep_handle,
|
||||
|
||||
/* Setup and start the Transfer */
|
||||
if (req->dw_align_buf) {
|
||||
if (ep->dwc_ep.is_in)
|
||||
dwc_memcpy(req->dw_align_buf,
|
||||
buf, buflen);
|
||||
ep->dwc_ep.dma_addr =
|
||||
req->dw_align_buf_dma;
|
||||
ep->dwc_ep.start_xfer_buff =
|
||||
|
||||
Reference in New Issue
Block a user