usb: mtu3: flush cache for the first GPD when allocate GPD ring

When allocate the GPD ring, and tell its address to the controller, then
the driver starts or resumes the QMU, the controller will try to access
the first GPD, so need flush the first one to avoid wrong GPD status.

Reported-by: Xin Lin <Xin.Lin@mediatek.com>
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
This commit is contained in:
Chunfeng Yun 2021-10-21 13:33:07 +08:00 committed by Marek Vasut
parent b8bfe05282
commit 2c4f21763d

View File

@ -112,6 +112,7 @@ int mtu3_gpd_ring_alloc(struct mtu3_ep *mep)
memset(gpd, 0, QMU_GPD_RING_SIZE); memset(gpd, 0, QMU_GPD_RING_SIZE);
ring->dma = (dma_addr_t)gpd; ring->dma = (dma_addr_t)gpd;
gpd_ring_init(ring, gpd); gpd_ring_init(ring, gpd);
mtu3_flush_cache((uintptr_t)gpd, sizeof(*gpd));
return 0; return 0;
} }