Skip to content

Commit

Permalink
dma-mapping: take dma_pfn_offset into account in dma_max_pfn
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Christoph Hellwig committed Jan 10, 2018
1 parent 8fbc02a commit a41ef1e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/linux/dma-mapping.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit a41ef1e

Please sign in to comment.