lkml.org 
[lkml]   [2018]   [Jul]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1/2] mips: Fix mips_dma_map_sg by using correct dma mapping function
Date
sg list elements could cover more than one page of data. Therefore
using plat_map_dma_mem_page() doesn't work for platforms, which have
IOMMU functionality hidden behind plat_map_dma_XXX functions.

Fixes: e36863a550da ("MIPS: HIGHMEM DMA on noncoherent MIPS32 processors")
Signed-off-by: Thomas Bogendoerfer <tbogendoerfer@suse.de>
---
arch/mips/mm/dma-default.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/mips/mm/dma-default.c b/arch/mips/mm/dma-default.c
index f9fef0028ca2..2718185a3d38 100644
--- a/arch/mips/mm/dma-default.c
+++ b/arch/mips/mm/dma-default.c
@@ -288,8 +288,8 @@ static int mips_dma_map_sg(struct device *dev, struct scatterlist *sglist,
#ifdef CONFIG_NEED_SG_DMA_LENGTH
sg->dma_length = sg->length;
#endif
- sg->dma_address = plat_map_dma_mem_page(dev, sg_page(sg)) +
- sg->offset;
+ sg->dma_address = plat_map_dma_mem(dev, sg_virt(sg),
+ sg->length);
}

return nents;
--
2.13.7
\
 
 \ /
  Last update: 2018-07-11 13:39    [W:0.039 / U:6.680 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site