diff options
author | Catalin Marinas | 2014-03-24 05:35:35 -0500 |
---|---|---|
committer | Mark Brown | 2014-08-11 15:39:26 -0500 |
commit | fec428515d877aba91e5dbe59883584dc0afffba (patch) | |
tree | 4df3b5ec3f93ffe5028376679b11d86bc6aa753a | |
parent | bd963e5ed978651e0086b898b613aebc181f6b77 (diff) | |
download | kernel-video-fec428515d877aba91e5dbe59883584dc0afffba.tar.gz kernel-video-fec428515d877aba91e5dbe59883584dc0afffba.tar.xz kernel-video-fec428515d877aba91e5dbe59883584dc0afffba.zip |
arm64: Remove pgprot_dmacoherent()
Since this macro is identical to pgprot_writecombine() and is only used
in a single place, remove it completely to avoid confusion. On ARMv7+
processors, the coherent DMA mapping must be Normal NonCacheable (a.k.a.
writecombine) to avoid mismatched hardware attribute aliases (with the
kernel linear mapping as Normal Cacheable).
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
(cherry picked from commit 196adf2f3015eacac0567278ba538e3ffdd16d0e)
Signed-off-by: Mark Brown <broonie@linaro.org>
-rw-r--r-- | arch/arm64/include/asm/pgtable.h | 2 | ||||
-rw-r--r-- | arch/arm64/mm/dma-mapping.c | 4 |
2 files changed, 1 insertions, 5 deletions
diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h index 1acb1eedece..65347e6efb9 100644 --- a/arch/arm64/include/asm/pgtable.h +++ b/arch/arm64/include/asm/pgtable.h | |||
@@ -280,8 +280,6 @@ static inline int has_transparent_hugepage(void) | |||
280 | __pgprot_modify(prot, PTE_ATTRINDX_MASK, PTE_ATTRINDX(MT_DEVICE_nGnRnE) | PTE_PXN | PTE_UXN) | 280 | __pgprot_modify(prot, PTE_ATTRINDX_MASK, PTE_ATTRINDX(MT_DEVICE_nGnRnE) | PTE_PXN | PTE_UXN) |
281 | #define pgprot_writecombine(prot) \ | 281 | #define pgprot_writecombine(prot) \ |
282 | __pgprot_modify(prot, PTE_ATTRINDX_MASK, PTE_ATTRINDX(MT_NORMAL_NC) | PTE_PXN | PTE_UXN) | 282 | __pgprot_modify(prot, PTE_ATTRINDX_MASK, PTE_ATTRINDX(MT_NORMAL_NC) | PTE_PXN | PTE_UXN) |
283 | #define pgprot_dmacoherent(prot) \ | ||
284 | __pgprot_modify(prot, PTE_ATTRINDX_MASK, PTE_ATTRINDX(MT_NORMAL_NC) | PTE_PXN | PTE_UXN) | ||
285 | #define __HAVE_PHYS_MEM_ACCESS_PROT | 283 | #define __HAVE_PHYS_MEM_ACCESS_PROT |
286 | struct file; | 284 | struct file; |
287 | extern pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn, | 285 | extern pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn, |
diff --git a/arch/arm64/mm/dma-mapping.c b/arch/arm64/mm/dma-mapping.c index 9337524601e..c851eb44dc5 100644 --- a/arch/arm64/mm/dma-mapping.c +++ b/arch/arm64/mm/dma-mapping.c | |||
@@ -36,10 +36,8 @@ EXPORT_SYMBOL(dma_ops); | |||
36 | static pgprot_t __get_dma_pgprot(struct dma_attrs *attrs, pgprot_t prot, | 36 | static pgprot_t __get_dma_pgprot(struct dma_attrs *attrs, pgprot_t prot, |
37 | bool coherent) | 37 | bool coherent) |
38 | { | 38 | { |
39 | if (dma_get_attr(DMA_ATTR_WRITE_COMBINE, attrs)) | 39 | if (!coherent || dma_get_attr(DMA_ATTR_WRITE_COMBINE, attrs)) |
40 | return pgprot_writecombine(prot); | 40 | return pgprot_writecombine(prot); |
41 | else if (!coherent) | ||
42 | return pgprot_dmacoherent(prot); | ||
43 | return prot; | 41 | return prot; |
44 | } | 42 | } |
45 | 43 | ||