public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ming Lei <tom.leiming@gmail.com>
To: Russell King - ARM Linux <linux@arm.linux.org.uk>
Cc: joerg.roedel@amd.com, linux-arm-kernel@lists.arm.linux.org.uk,
	linux-kernel@vger.kernel.org, akpm@linux-foundation.org
Subject: Re: [PATCH 0/3] ARM:dma-mapping:Support DMA-API debugging facility on ARM
Date: Fri, 17 Jul 2009 23:07:20 +0800	[thread overview]
Message-ID: <20090717230720.0e486907@linux-lm> (raw)
In-Reply-To: <20090717081149.GB3174@n2100.arm.linux.org.uk>

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

      reply	other threads:[~2009-07-17 15:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-11 16:07 [PATCH 0/3] ARM:dma-mapping:Support DMA-API debugging facility on ARM tom.leiming
2009-07-11 16:07 ` [PATCH 1/3] ARM:dma-mapping:wrappers for dma-api tom.leiming
2009-07-11 16:07   ` [PATCH 2/3] ARM:dma-mapping:only provide one set of dma-api wrappers tom.leiming
2009-07-11 16:07     ` [PATCH 3/3] ARM:dma-mapping:Support DMA-API debugging facility on ARM tom.leiming
2009-07-17  0:02 ` [PATCH 0/3] " Ming Lei
2009-07-17  8:11   ` Russell King - ARM Linux
2009-07-17 15:07     ` Ming Lei [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090717230720.0e486907@linux-lm \
    --to=tom.leiming@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=joerg.roedel@amd.com \
    --cc=linux-arm-kernel@lists.arm.linux.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox