Skip to content

Commit 7bd6680

Browse files
committed
Revert "Revert "arm64: dma: Drop cache invalidation from arch_dma_prep_coherent()""
This reverts commit b7d9aae. With the Qualcomm remoteproc driver now modified to use a carveout memory region in 57f7217 ("remoteproc: qcom_q6v5_mss: Use a carveout to authenticate modem headers"), we can reinstate c44094e ("arm64: dma: Drop cache invalidation from arch_dma_prep_coherent()") which relaxes the arm64 implementation of arch_dma_prep_coherent() to perform only a data cache clean operation, rather than a clean-and-invalidate. Signed-off-by: Will Deacon <[email protected]>
1 parent 7cae569 commit 7bd6680

File tree

1 file changed

+1
-16
lines changed

1 file changed

+1
-16
lines changed

arch/arm64/mm/dma-mapping.c

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -36,22 +36,7 @@ void arch_dma_prep_coherent(struct page *page, size_t size)
3636
{
3737
unsigned long start = (unsigned long)page_address(page);
3838

39-
/*
40-
* The architecture only requires a clean to the PoC here in order to
41-
* meet the requirements of the DMA API. However, some vendors (i.e.
42-
* Qualcomm) abuse the DMA API for transferring buffers from the
43-
* non-secure to the secure world, resetting the system if a non-secure
44-
* access shows up after the buffer has been transferred:
45-
*
46-
* https://lore.kernel.org/r/[email protected]
47-
*
48-
* Using clean+invalidate appears to make this issue less likely, but
49-
* the drivers themselves still need fixing as the CPU could issue a
50-
* speculative read from the buffer via the linear mapping irrespective
51-
* of the cache maintenance we use. Once the drivers are fixed, we can
52-
* relax this to a clean operation.
53-
*/
54-
dcache_clean_inval_poc(start, start + size);
39+
dcache_clean_poc(start, start + size);
5540
}
5641

5742
#ifdef CONFIG_IOMMU_DMA

0 commit comments

Comments
 (0)