aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-09-02 23:09:36 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2018-09-02 23:09:36 -0400
commit60c1f89241d49bacf71035470684a8d7b4bb46ea (patch)
treef545bc7a0ddd189b956e65353f36661f4fc12ae1 /kernel
parent57361846b52bc686112da6ca5368d11210796804 (diff)
parent8c89ef7b6b64ba093239305f77a485905d03f7bf (diff)
Merge tag 'dma-mapping-4.19-2' of git://git.infradead.org/users/hch/dma-mapping
Pull dma-mapping fixes from Christoph Hellwig: "A few fixes for the fallout of being a little more pedantic about dma masks" * tag 'dma-mapping-4.19-2' of git://git.infradead.org/users/hch/dma-mapping: of/platform: initialise AMBA default DMA masks sparc: set a default 32-bit dma mask for OF devices kernel/dma/direct: take DMA offset into account in dma_direct_supported
Diffstat (limited to 'kernel')
-rw-r--r--kernel/dma/direct.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/dma/direct.c b/kernel/dma/direct.c
index 1c35b7b945d0..de87b0282e74 100644
--- a/kernel/dma/direct.c
+++ b/kernel/dma/direct.c
@@ -168,7 +168,7 @@ int dma_direct_map_sg(struct device *dev, struct scatterlist *sgl, int nents,
168int dma_direct_supported(struct device *dev, u64 mask) 168int dma_direct_supported(struct device *dev, u64 mask)
169{ 169{
170#ifdef CONFIG_ZONE_DMA 170#ifdef CONFIG_ZONE_DMA
171 if (mask < DMA_BIT_MASK(ARCH_ZONE_DMA_BITS)) 171 if (mask < phys_to_dma(dev, DMA_BIT_MASK(ARCH_ZONE_DMA_BITS)))
172 return 0; 172 return 0;
173#else 173#else
174 /* 174 /*
@@ -177,7 +177,7 @@ int dma_direct_supported(struct device *dev, u64 mask)
177 * memory, or by providing a ZONE_DMA32. If neither is the case, the 177 * memory, or by providing a ZONE_DMA32. If neither is the case, the
178 * architecture needs to use an IOMMU instead of the direct mapping. 178 * architecture needs to use an IOMMU instead of the direct mapping.
179 */ 179 */
180 if (mask < DMA_BIT_MASK(32)) 180 if (mask < phys_to_dma(dev, DMA_BIT_MASK(32)))
181 return 0; 181 return 0;
182#endif 182#endif
183 /* 183 /*