lkml.org 
[lkml]   [2009]   [Jul]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH 0/3] ARM:dma-mapping:Support DMA-API debugging facility on ARM
On Fri, 17 Jul 2009 09:11:49 +0100
Russell King - ARM Linux <linux@arm.linux.org.uk> wrote:

> I don't think it's suitable, because our implementation calls back
> into the DMA API for dma_map_sg() - this means that the debugging
> code will end up seeing each scatterlist entry twice. I'm not sure
> what effect that will have, but it's probably not good.

Thank you for the review, and does the patch fix the problem?
If yes, I'll sumbmit the v2 version if necessary or you can use it directly.

From cd2ef8fc869a2e3442fc37d695ca95d286ac6a4d Mon Sep 17 00:00:00 2001
From: Ming Lei <tom.leiming@gmail.com>
Date: Fri, 17 Jul 2009 22:54:01 +0800
Subject: [PATCH 4/4] ARM:dma-mapping:fix dma_map_sg and dma_unmap_sg

This patch removes unnecessary calling of debug_dma_map_page
and debug_dma_unmap_page in dma_map_sg and dma_unmap_sg.

Signed-off-by: Ming Lei <tom.leiming@gmail.com>
---
arch/arm/mm/dma-mapping.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
index 64e5d82..584018c 100644
--- a/arch/arm/mm/dma-mapping.c
+++ b/arch/arm/mm/dma-mapping.c
@@ -610,7 +610,7 @@ int __dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
int i, j;

for_each_sg(sg, s, nents, i) {
- s->dma_address = dma_map_page(dev, sg_page(s), s->offset,
+ s->dma_address = __dma_map_page(dev, sg_page(s), s->offset,
s->length, dir);
if (dma_mapping_error(dev, s->dma_address))
goto bad_mapping;
@@ -619,7 +619,7 @@ int __dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,

bad_mapping:
for_each_sg(sg, s, i, j)
- dma_unmap_page(dev, sg_dma_address(s), sg_dma_len(s), dir);
+ __dma_unmap_single(dev, sg_dma_address(s), sg_dma_len(s), dir);
return 0;
}
EXPORT_SYMBOL(__dma_map_sg);
@@ -641,7 +641,7 @@ void __dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nents,
int i;

for_each_sg(sg, s, nents, i)
- dma_unmap_page(dev, sg_dma_address(s), sg_dma_len(s), dir);
+ __dma_unmap_single(dev, sg_dma_address(s), sg_dma_len(s), dir);
}
EXPORT_SYMBOL(__dma_unmap_sg);

--
1.6.0.GIT



--
Lei Ming


\
 
 \ /
  Last update: 2009-07-17 17:09    [W:0.037 / U:0.272 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site