Hi Han,

On 04:29 Sat 19 Sep     , Han Gao wrote:
> Use CIPA instead of CPA to clean and invalidate cache lines. This
> fixes stale DMA descriptors breaking USB enumeration on TH1520.
> 
I suspect this isn't a correct fix, there are separate functions for dcache
flush and invalidate - flush_dcache_range() vs invalidate_dcache_range()

Better to check the USB driver, where it actually need to flush or invalidate?

> Signed-off-by: Han Gao <[email protected]>
> ---
>  arch/riscv/lib/thead_cmo.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/riscv/lib/thead_cmo.c b/arch/riscv/lib/thead_cmo.c
> index b8051e29e02b..763ff799eddd 100644
> --- a/arch/riscv/lib/thead_cmo.c
> +++ b/arch/riscv/lib/thead_cmo.c
> @@ -40,6 +40,6 @@ void flush_dcache_range(unsigned long start, unsigned long 
> end)
>  {
>       register unsigned long i asm("a0") = start & 
> ~(CONFIG_SYS_CACHELINE_SIZE - 1);
>       for (; i < end; i += CONFIG_SYS_CACHELINE_SIZE)
> -             __asm__ __volatile__(DCACHE_CPA_A0);
> +             __asm__ __volatile__(DCACHE_CIPA_A0);
>       __asm__ __volatile__(SYNC_S);
>  }
> 
> ---
> base-commit: 211de43d0f954a00a490220c1aac9db298287c40
> change-id: 20260919-fixcmo-cf56064fccd6
> 
> Best regards,
> --  
> Han Gao <[email protected]>
> 

-- 
Yixun Lan (dlan)

Reply via email to