Skip to content

Commit 7607cb7

Browse files
author
Christoph Hellwig
committed
ARM/dma-mapping: take the bus limit into account in __dma_alloc
The DMA coherent allocator needs to take bus limits into account for picking the zone that the memory is allocated from. Reported-by: Roger Quadros <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]> Tested-by: Peter Ujfalusi <[email protected]> Tested-by: Roger Quadros <[email protected]>
1 parent fd50924 commit 7607cb7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/arm/mm/dma-mapping.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,7 @@ static void *__dma_alloc(struct device *dev, size_t size, dma_addr_t *handle,
658658
gfp_t gfp, pgprot_t prot, bool is_coherent,
659659
unsigned long attrs, const void *caller)
660660
{
661-
u64 mask = dev->coherent_dma_mask;
661+
u64 mask = min_not_zero(dev->coherent_dma_mask, dev->bus_dma_limit);
662662
struct page *page = NULL;
663663
void *addr;
664664
bool allowblock, cma;

0 commit comments

Comments
 (0)