Skip to content

Commit 8ed710d

Browse files
committed
Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux
Pull arm64 fix from Catalin Marinas: "Revert the dropping of the cache invalidation from the arm64 arch_dma_prep_coherent() as it caused a regression in the qcom_q6v5_mss remoteproc driver. The driver is already buggy but the original arm64 change made the problem obvious. The change will be re-introduced once the driver is fixed" * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: Revert "arm64: dma: Drop cache invalidation from arch_dma_prep_coherent()"
2 parents 5b3e0cd + b7d9aae commit 8ed710d

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

arch/arm64/mm/dma-mapping.c

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

39-
dcache_clean_poc(start, start + size);
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);
4055
}
4156

4257
#ifdef CONFIG_IOMMU_DMA

0 commit comments

Comments
 (0)