Commit a41ef1e4 authored by Christoph Hellwig's avatar Christoph Hellwig

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: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarRobin Murphy <robin.murphy@arm.com>
parent 8fbc02ac
...@@ -692,7 +692,7 @@ static inline int dma_set_seg_boundary(struct device *dev, unsigned long mask) ...@@ -692,7 +692,7 @@ static inline int dma_set_seg_boundary(struct device *dev, unsigned long mask)
#ifndef dma_max_pfn #ifndef dma_max_pfn
static inline unsigned long dma_max_pfn(struct device *dev) 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 #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment