diff mbox series

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

Message ID 20211021053307.8502-1-chunfeng.yun@mediatek.com
State Accepted
Commit 2c4f21763d7132bc355d343347032bd6d2f199f4
Delegated to: Marek Vasut
Headers show
Series [RESEND] usb: mtu3: flush cache for the first GPD when allocate GPD ring | expand

Commit Message

Chunfeng Yun (云春峰) Oct. 21, 2021, 5:33 a.m. UTC
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>
---
 drivers/usb/mtu3/mtu3_qmu.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Chunfeng Yun (云春峰) Nov. 2, 2021, 2:45 a.m. UTC | #1
Hi Marek,

On Thu, 2021-10-21 at 13:33 +0800, Chunfeng Yun wrote:
> 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>
> ---
>  drivers/usb/mtu3/mtu3_qmu.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/usb/mtu3/mtu3_qmu.c
> b/drivers/usb/mtu3/mtu3_qmu.c
> index 95eaf6d236..e8dc0095ab 100644
> --- a/drivers/usb/mtu3/mtu3_qmu.c
> +++ b/drivers/usb/mtu3/mtu3_qmu.c
> @@ -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
Chunfeng Yun (云春峰) Nov. 2, 2021, 2:50 a.m. UTC | #2
Hi Marek,

On Thu, 2021-10-21 at 13:33 +0800, Chunfeng Yun wrote:
> 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>
> ---
>  drivers/usb/mtu3/mtu3_qmu.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/usb/mtu3/mtu3_qmu.c
> b/drivers/usb/mtu3/mtu3_qmu.c
> index 95eaf6d236..e8dc0095ab 100644
> --- a/drivers/usb/mtu3/mtu3_qmu.c
> +++ b/drivers/usb/mtu3/mtu3_qmu.c
> @@ -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
Chunfeng Yun (云春峰) Nov. 2, 2021, 7:19 a.m. UTC | #3
Hi Marek,

On Thu, 2021-10-21 at 13:33 +0800, Chunfeng Yun wrote:
> 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>
> ---
>  drivers/usb/mtu3/mtu3_qmu.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/usb/mtu3/mtu3_qmu.c
> b/drivers/usb/mtu3/mtu3_qmu.c
> index 95eaf6d236..e8dc0095ab 100644
> --- a/drivers/usb/mtu3/mtu3_qmu.c
> +++ b/drivers/usb/mtu3/mtu3_qmu.c
> @@ -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
Chunfeng Yun (云春峰) Nov. 3, 2021, 2:31 a.m. UTC | #4
Hi Marek,

On Thu, 2021-10-21 at 13:33 +0800, Chunfeng Yun wrote:
> 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>
> ---
>  drivers/usb/mtu3/mtu3_qmu.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/usb/mtu3/mtu3_qmu.c
> b/drivers/usb/mtu3/mtu3_qmu.c
> index 95eaf6d236..e8dc0095ab 100644
> --- a/drivers/usb/mtu3/mtu3_qmu.c
> +++ b/drivers/usb/mtu3/mtu3_qmu.c
> @@ -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
Chunfeng Yun (云春峰) Nov. 3, 2021, 2:39 a.m. UTC | #5
Hi Marek,

On Thu, 2021-10-21 at 13:33 +0800, Chunfeng Yun wrote:
> 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>
> ---
>  drivers/usb/mtu3/mtu3_qmu.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/usb/mtu3/mtu3_qmu.c
> b/drivers/usb/mtu3/mtu3_qmu.c
> index 95eaf6d236..e8dc0095ab 100644
> --- a/drivers/usb/mtu3/mtu3_qmu.c
> +++ b/drivers/usb/mtu3/mtu3_qmu.c
> @@ -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
Marek Vasut Nov. 3, 2021, 10:13 a.m. UTC | #6
On 11/3/21 3:39 AM, Chunfeng Yun wrote:
> Hi Marek,
> 
> On Thu, 2021-10-21 at 13:33 +0800, Chunfeng Yun wrote:
>> 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>
>> ---
>>   drivers/usb/mtu3/mtu3_qmu.c | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/usb/mtu3/mtu3_qmu.c
>> b/drivers/usb/mtu3/mtu3_qmu.c
>> index 95eaf6d236..e8dc0095ab 100644
>> --- a/drivers/usb/mtu3/mtu3_qmu.c
>> +++ b/drivers/usb/mtu3/mtu3_qmu.c
>> @@ -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?

Should be on its way, thanks for the reminder.
diff mbox series

Patch

diff --git a/drivers/usb/mtu3/mtu3_qmu.c b/drivers/usb/mtu3/mtu3_qmu.c
index 95eaf6d236..e8dc0095ab 100644
--- a/drivers/usb/mtu3/mtu3_qmu.c
+++ b/drivers/usb/mtu3/mtu3_qmu.c
@@ -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;
 }