Skip to contentSkip to conversation

usb: mtu3: flush cache for next GPD

PATCH New Chunfeng Yun 2 participants 2 messages Mar 3, 2021

Subsystems (2)
lore
Share & tools
lore

Chunfeng Yun

author maintainer
#0 lore raw

PATCH 1/1 usb: mtu3: flush cache for next GPD

When flush cache of the current GPD and resume QMU, the controller will try to access the next GPD after processing the current one, if not flush the next GPD, the controller may get wrong GPD status.

---
 drivers/usb/mtu3/mtu3_qmu.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/usb/mtu3/mtu3_qmu.c +3 -0
index 801c2bc416..95eaf6d236 100644
@@ -198,6 +198,7 @@ static int mtu3_prepare_tx_gpd(struct mtu3_ep *mep, struct mtu3_request *mreq)
 
 	enq->flag &= ~GPD_FLAGS_HWO;
 	gpd->next_gpd = cpu_to_le32((u32)gpd_virt_to_dma(ring, enq));
+	mtu3_flush_cache((uintptr_t)enq, sizeof(*gpd));
 
 	if (req->zero)
 		gpd->ext_flag |= GPD_EXT_FLAG_ZLP;
@@ -234,6 +235,8 @@ static int mtu3_prepare_rx_gpd(struct mtu3_ep *mep, struct mtu3_request *mreq)
 
 	enq->flag &= ~GPD_FLAGS_HWO;
 	gpd->next_gpd = cpu_to_le32((u32)gpd_virt_to_dma(ring, enq));
+	mtu3_flush_cache((uintptr_t)enq, sizeof(*gpd));
+
 	gpd->flag |= GPD_FLAGS_IOC | GPD_FLAGS_HWO;
 
 	mreq->gpd = gpd;
Signature · 1 line
2.18.0
Applied
#1 lore raw

PATCH 1/1 usb: mtu3: flush cache for next GPD

Quoted 3 lines · Chunfeng Yun

When flush cache of the current GPD and resume QMU, the controller will try to access the next GPD after processing the current one, if not flush the next GPD, the controller may get wrong GPD status.

Applied, thanks