lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Fri, 17 Jul 2009 23:07:20 +0800
From:	Ming Lei <tom.leiming@...il.com>
To:	Russell King - ARM Linux <linux@....linux.org.uk>
Cc:	joerg.roedel@....com, linux-arm-kernel@...ts.arm.linux.org.uk,
	linux-kernel@...r.kernel.org, akpm@...ux-foundation.org
Subject: Re: [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@....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@...il.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@...il.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ