Re: [PATCH] iommu/dma: Add support for DMA_ATTR_SYS_CACHE
From: Christoph Hellwig
Date: Mon Oct 28 2019 - 07:37:33 EST
On Mon, Oct 28, 2019 at 11:24:58AM +0000, Will Deacon wrote:
> Agreed. The way I /think/ it works is that on many SoCs there is a
> system/last-level cache (LLC) which effectively sits in front of memory for
> all masters. Even if a device isn't coherent with the CPU caches, we still
> want to be able to allocate into the LLC. Why this doesn't happen
> automatically is beyond me, but it appears that on these Qualcomm designs
> you actually have to set the memory attributes up in the page-table to
> ensure that the resulting memory transactions are non-cacheable for the CPU
> but cacheable for the LLC. Without any changes, the transactions are
> non-cacheable in both of them which assumedly has a performance cost.
> But you can see that I'm piecing things together myself here. Isaac?
If that is the case it sounds like we'd want to drive this through
DT properties, not the driver API. But again, without an actual consumer
it pretty much is a moot point anyway.