On Sun, Sep 20, 2026 at 12:56:09AM +0000, Yixun Lan wrote:
> 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?

Whether the USB driver needs a flush or only invalidation or not, the
current thead_cmo.c only cleans the cacheline in flush_dcache_range(),
which is wrong.

But out of curiosity, I have a look at DWC3, and found at least the call
in dwc3_ep0_start_trans() requires dwc3_flush_dcache(), which is a
wrapper over flush_dcache_range(), to really clean the cache, otherwise
the DMA data and TRB might not be visible to an incoherent DWC3.

> > Signed-off-by: Han Gao <[email protected]>

Regards,
Yao Zi

Reply via email to