linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] mips: Fix mips_dma_map_sg by using correct dma mapping function
@ 2018-07-11 11:38 Thomas Bogendoerfer
  2018-07-11 11:38 ` [PATCH 2/2] mips/jazz: provide dma_mask/coherent_dma_mask for platform devices Thomas Bogendoerfer
  2018-07-11 16:03 ` [PATCH 1/2] mips: Fix mips_dma_map_sg by using correct dma mapping function Paul Burton
  0 siblings, 2 replies; 6+ messages in thread
From: Thomas Bogendoerfer @ 2018-07-11 11:38 UTC (permalink / raw)
  To: Ralf Baechle, Paul Burton, James Hogan, linux-mips, linux-kernel

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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-07-11 20:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-11 11:38 [PATCH 1/2] mips: Fix mips_dma_map_sg by using correct dma mapping function Thomas Bogendoerfer
2018-07-11 11:38 ` [PATCH 2/2] mips/jazz: provide dma_mask/coherent_dma_mask for platform devices Thomas Bogendoerfer
2018-07-11 16:15   ` Paul Burton
2018-07-11 20:52     ` Thomas Bogendoerfer
2018-07-11 16:03 ` [PATCH 1/2] mips: Fix mips_dma_map_sg by using correct dma mapping function Paul Burton
2018-07-11 20:50   ` Thomas Bogendoerfer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).