summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2017-11-30 18:32:51 +0300
committerChristoph Hellwig <hch@lst.de>2018-01-10 18:25:06 +0300
commita41ef1e455a9796be8cb986f0616f52453ac8e4b (patch)
tree6c8a67935171bbda4c1be624bb8bca40f9c72e7e
parent8fbc02ac62677603e75a67385fccd0c0bc69fa5c (diff)
downloadlinux-a41ef1e455a9796be8cb986f0616f52453ac8e4b.tar.xz
dma-mapping: take dma_pfn_offset into account in dma_max_pfn
This makes sure the generic version can be used with architectures / devices that have a DMA offset in the direct mapping. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Robin Murphy <robin.murphy@arm.com>
-rw-r--r--include/linux/dma-mapping.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
index 81ed9b2d84dc..d84951865be7 100644
--- a/include/linux/dma-mapping.h
+++ b/include/linux/dma-mapping.h
@@ -692,7 +692,7 @@ static inline int dma_set_seg_boundary(struct device *dev, unsigned long mask)
#ifndef dma_max_pfn
static inline unsigned long dma_max_pfn(struct device *dev)
{
- return *dev->dma_mask >> PAGE_SHIFT;
+ return (*dev->dma_mask >> PAGE_SHIFT) + dev->dma_pfn_offset;
}
#endif