summaryrefslogtreecommitdiff
path: root/arch/arm/mm/dma-mapping.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2020-02-17 12:50:23 +0100
committerChristoph Hellwig <hch@lst.de>2020-03-20 11:43:21 +0100
commit7607cb733fbb6dfac88c4a85c113e8104c91733e (patch)
treed141333cdc3db651e770256defb2029e6ab1d02d /arch/arm/mm/dma-mapping.c
parentfd50924917f98f11554e3bf55b0d062e09bce541 (diff)
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 <rogerq@ti.com> Signed-off-by: Christoph Hellwig <hch@lst.de> Tested-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Tested-by: Roger Quadros <rogerq@ti.com>
Diffstat (limited to 'arch/arm/mm/dma-mapping.c')
-rw-r--r--arch/arm/mm/dma-mapping.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
index 72ddc3d0f5eb..87aba505554a 100644
--- a/arch/arm/mm/dma-mapping.c
+++ b/arch/arm/mm/dma-mapping.c
@@ -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;