Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1205630 > unrolled thread

[PATCH 26/31] openrisc: handle page-less SG entries

Started byChristoph Hellwig <hch@lst.de>
First post2015-08-12 09:20 +0200
Last post2015-08-12 09:20 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 26/31] openrisc: handle page-less SG entries Christoph Hellwig <hch@lst.de> - 2015-08-12 09:20 +0200

#1205630 — [PATCH 26/31] openrisc: handle page-less SG entries

FromChristoph Hellwig <hch@lst.de>
Date2015-08-12 09:20 +0200
Subject[PATCH 26/31] openrisc: handle page-less SG entries
Message-ID<pWyum-5LM-7@gated-at.bofh.it>
Make all cache invalidation conditional on sg_has_page() and use
sg_phys to get the physical address directly.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 arch/openrisc/kernel/dma.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/arch/openrisc/kernel/dma.c b/arch/openrisc/kernel/dma.c
index 0b77ddb..94ed052 100644
--- a/arch/openrisc/kernel/dma.c
+++ b/arch/openrisc/kernel/dma.c
@@ -184,8 +184,13 @@ or1k_map_sg(struct device *dev, struct scatterlist *sg,
 	int i;
 
 	for_each_sg(sg, s, nents, i) {
-		s->dma_address = or1k_map_page(dev, sg_page(s), s->offset,
-					       s->length, dir, NULL);
+		if (sg_has_page(s)) {
+			s->dma_address = or1k_map_page(dev, sg_page(s),
+						s->offset, s->length, dir,
+						NULL);
+		} else {
+			s->dma_address = sg_phys(s);
+		}
 	}
 
 	return nents;
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web