Skip to contentSkip to conversation

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

PATCH RESEND In review Chunfeng Yun 2 participants 7 messages Oct 21, 2021 – Nov 13, 2021

Subsystems (2)
lore
Share & tools
lore

Chunfeng Yun

author maintainer
#0 lore raw

PATCH RESEND 1/1 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.

---
 drivers/usb/mtu3/mtu3_qmu.c | 1 +
 1 file changed, 1 insertion(+)
drivers/usb/mtu3/mtu3_qmu.c +1 -0
index 95eaf6d236..e8dc0095ab 100644
@@ -112,6 +112,7 @@ int mtu3_gpd_ring_alloc(struct mtu3_ep *mep)
 	memset(gpd, 0, QMU_GPD_RING_SIZE);
 	ring->dma = (dma_addr_t)gpd;
 	gpd_ring_init(ring, gpd);
+	mtu3_flush_cache((uintptr_t)gpd, sizeof(*gpd));
 
 	return 0;
 }
Signature · 1 line
2.25.1
author maintainer
#1 lore raw

Hi Marek,

Quoted 18 lines · Chunfeng Yun

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.

---
 drivers/usb/mtu3/mtu3_qmu.c | 1 +
 1 file changed, 1 insertion(+)
drivers/usb/mtu3/mtu3_qmu.c +0 -0
index 95eaf6d236..e8dc0095ab 100644

drivers/usb/mtu3/mtu3_qmu.c int mtu3_gpd_ring_alloc(struct mtu3_ep *mep) · line 118

Quoted 7 lines
drivers/usb/mtu3/mtu3_qmu.c +1 -0
@@ -112,6 +112,7 @@ int mtu3_gpd_ring_alloc(struct mtu3_ep *mep)
 	memset(gpd, 0, QMU_GPD_RING_SIZE);
 	ring->dma = (dma_addr_t)gpd;
 	gpd_ring_init(ring, gpd);
+	mtu3_flush_cache((uintptr_t)gpd, sizeof(*gpd));
 
 	return 0;
 }

Could you please pick up this patch?

Thanks

#2 lore raw
Quoted 26 lines · Chunfeng Yun

Hi Marek,

Quoted 23 lines · Chunfeng Yun

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.

---
  drivers/usb/mtu3/mtu3_qmu.c | 1 +
  1 file changed, 1 insertion(+)
drivers/usb/mtu3/mtu3_qmu.c +1 -0
index 95eaf6d236..e8dc0095ab 100644
@@ -112,6 +112,7 @@ int mtu3_gpd_ring_alloc(struct mtu3_ep *mep)
  	memset(gpd, 0, QMU_GPD_RING_SIZE);
  	ring->dma = (dma_addr_t)gpd;
  	gpd_ring_init(ring, gpd);
+	mtu3_flush_cache((uintptr_t)gpd, sizeof(*gpd));
 
Quoted 3 lines

drivers/usb/mtu3/mtu3_qmu.c int mtu3_gpd_ring_alloc(struct mtu3_ep *mep) · line 118

Quoted 2 lines
drivers/usb/mtu3/mtu3_qmu.c +0 -0
  	return 0;
  }

Could you please pick up this patch?

Should be on its way, thanks for the reminder.

author maintainer
#3 lore raw
In reply to Chunfeng Yun

Hi Marek,

Quoted 18 lines · Chunfeng Yun

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.

---
 drivers/usb/mtu3/mtu3_qmu.c | 1 +
 1 file changed, 1 insertion(+)
drivers/usb/mtu3/mtu3_qmu.c +0 -0
index 95eaf6d236..e8dc0095ab 100644

drivers/usb/mtu3/mtu3_qmu.c int mtu3_gpd_ring_alloc(struct mtu3_ep *mep) · line 118

Quoted 7 lines
drivers/usb/mtu3/mtu3_qmu.c +1 -0
@@ -112,6 +112,7 @@ int mtu3_gpd_ring_alloc(struct mtu3_ep *mep)
 	memset(gpd, 0, QMU_GPD_RING_SIZE);
 	ring->dma = (dma_addr_t)gpd;
 	gpd_ring_init(ring, gpd);
+	mtu3_flush_cache((uintptr_t)gpd, sizeof(*gpd));
 
 	return 0;
 }

Could you please pick up this patch?

Thanks

author maintainer
#4 lore raw
In reply to Chunfeng Yun

Hi Marek,

Quoted 18 lines · Chunfeng Yun

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.

---
 drivers/usb/mtu3/mtu3_qmu.c | 1 +
 1 file changed, 1 insertion(+)
drivers/usb/mtu3/mtu3_qmu.c +0 -0
index 95eaf6d236..e8dc0095ab 100644

drivers/usb/mtu3/mtu3_qmu.c int mtu3_gpd_ring_alloc(struct mtu3_ep *mep) · line 118

Quoted 7 lines
drivers/usb/mtu3/mtu3_qmu.c +1 -0
@@ -112,6 +112,7 @@ int mtu3_gpd_ring_alloc(struct mtu3_ep *mep)
 	memset(gpd, 0, QMU_GPD_RING_SIZE);
 	ring->dma = (dma_addr_t)gpd;
 	gpd_ring_init(ring, gpd);
+	mtu3_flush_cache((uintptr_t)gpd, sizeof(*gpd));
 
 	return 0;
 }

Could you please pick up this patch?

Thanks

author maintainer
#5 lore raw
In reply to Chunfeng Yun

Hi Marek,

Quoted 18 lines · Chunfeng Yun

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.

---
 drivers/usb/mtu3/mtu3_qmu.c | 1 +
 1 file changed, 1 insertion(+)
drivers/usb/mtu3/mtu3_qmu.c +0 -0
index 95eaf6d236..e8dc0095ab 100644

drivers/usb/mtu3/mtu3_qmu.c int mtu3_gpd_ring_alloc(struct mtu3_ep *mep) · line 118

Quoted 7 lines
drivers/usb/mtu3/mtu3_qmu.c +1 -0
@@ -112,6 +112,7 @@ int mtu3_gpd_ring_alloc(struct mtu3_ep *mep)
 	memset(gpd, 0, QMU_GPD_RING_SIZE);
 	ring->dma = (dma_addr_t)gpd;
 	gpd_ring_init(ring, gpd);
+	mtu3_flush_cache((uintptr_t)gpd, sizeof(*gpd));
 
 	return 0;
 }

Could you please pick up this patch?

Thanks

author maintainer
#6 lore raw
In reply to Chunfeng Yun

Hi Marek,

Quoted 18 lines · Chunfeng Yun

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.

---
 drivers/usb/mtu3/mtu3_qmu.c | 1 +
 1 file changed, 1 insertion(+)
drivers/usb/mtu3/mtu3_qmu.c +0 -0
index 95eaf6d236..e8dc0095ab 100644

drivers/usb/mtu3/mtu3_qmu.c int mtu3_gpd_ring_alloc(struct mtu3_ep *mep) · line 118

Quoted 7 lines
drivers/usb/mtu3/mtu3_qmu.c +1 -0
@@ -112,6 +112,7 @@ int mtu3_gpd_ring_alloc(struct mtu3_ep *mep)
 	memset(gpd, 0, QMU_GPD_RING_SIZE);
 	ring->dma = (dma_addr_t)gpd;
 	gpd_ring_init(ring, gpd);
+	mtu3_flush_cache((uintptr_t)gpd, sizeof(*gpd));
 
 	return 0;
 }

Could you please pick up this patch?

Thanks