Commit 7607cb73 authored by Christoph Hellwig's avatar Christoph Hellwig
Browse files

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: default avatarRoger Quadros <rogerq@ti.com>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Tested-by: default avatarPeter Ujfalusi <peter.ujfalusi@ti.com>
Tested-by: default avatarRoger Quadros <rogerq@ti.com>
parent fd509249
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -658,7 +658,7 @@ static void *__dma_alloc(struct device *dev, size_t size, dma_addr_t *handle,
			 gfp_t gfp, pgprot_t prot, bool is_coherent,
			 unsigned long attrs, const void *caller)
{
	u64 mask = dev->coherent_dma_mask;
	u64 mask = min_not_zero(dev->coherent_dma_mask, dev->bus_dma_limit);
	struct page *page = NULL;
	void *addr;
	bool allowblock, cma;