From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail172.messagelabs.com (mail172.messagelabs.com [216.82.254.3]) by kanga.kvack.org (Postfix) with ESMTP id CB8109000C6 for ; Tue, 20 Sep 2011 14:46:44 -0400 (EDT) From: Krishna Reddy Date: Tue, 20 Sep 2011 11:46:32 -0700 Subject: Re: [PATCH 1/2] ARM: initial proof-of-concept IOMMU mapper for DMA-mapping Message-ID: <401E54CE964CD94BAE1EB4A729C7087E1229036B69@HQMAIL04.nvidia.com> Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_401E54CE964CD94BAE1EB4A729C7087E1229036B69HQMAIL04nvidi_" MIME-Version: 1.0 Sender: owner-linux-mm@kvack.org List-ID: To: Linux-ARM Kernel Cc: Marek Szyprowski , linaro-mm-sig , linux-mm , linux-arch , Shariq Hasnain , Arnd Bergmann , Joerg Roedel , Kyungmin Park , Andrzej Pietrasiewicz , Russell King - ARM Linux , Chunsang Jeong --_000_401E54CE964CD94BAE1EB4A729C7087E1229036B69HQMAIL04nvidi_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi, The following change fixes a bug, which causes releasing incorrect iova spa= ce, in the original patch of this mail thread. It fixes compilation error e= ither. diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c index 82d5134..8c16ed7 100644 --- a/arch/arm/mm/dma-mapping.c +++ b/arch/arm/mm/dma-mapping.c @@ -900,10 +900,8 @@ static int __iommu_remove_mapping(struct device *dev, = dma_addr_t iova, size_t si unsigned int count =3D size >> PAGE_SHIFT; int i; - for (i=3D0; idomain, iova, 0); - iova +=3D PAGE_SIZE; - } + for (i=3D0; idomain, iova + i * PAGE_SIZE, 0); __free_iova(mapping, iova, size); return 0; } @@ -1073,7 +1071,7 @@ int arm_iommu_map_sg(struct device *dev, struct scatt= erlist *sg, int nents, size +=3D sg->length; } __map_sg_chunk(dev, start, size, &dma->dma_address, dir); - d->dma_address +=3D offset; + dma->dma_address +=3D offset; return count; --_000_401E54CE964CD94BAE1EB4A729C7087E1229036B69HQMAIL04nvidi_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable
Hi,
The following change fixes a bug, which causes releasing incorrect iov= a space, in the original patch of this mail thread. It fixes compilation er= ror either.
 
diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
index 82d5134..8c16ed7 100644
--- a/arch/arm/mm/dma-mapping.c
+++ b/arch/arm/mm/dma-mapping.c
@@ -900,10 +900,8 @@ static int __iommu_remove_mapping(struct devi= ce *dev, dma_addr_t iova, size_t si
        unsigned int count =3D size= >> PAGE_SHIFT;
        int i;
 
-       for (i=3D0; i<count; i+&#= 43;) {
-           &nb= sp;   iommu_unmap(mapping->domain, iova, 0);
-           &nb= sp;   iova +=3D PAGE_SIZE;
-       }
+       for (i=3D0; i<count; i= 3;+)
+           = ;    iommu_unmap(mapping->domain, iova + i * PAGE_SIZ= E, 0);
        __free_iova(mapping, iova, = size);
        return 0;
}
@@ -1073,7 +1071,7 @@ int arm_iommu_map_sg(struct device *dev, str= uct scatterlist *sg, int nents,
           &nbs= p;    size +=3D sg->length;
        }
        __map_sg_chunk(dev, start, = size, &dma->dma_address, dir);
-       d->dma_address +=3D offse= t;
+       dma->dma_address +=3D= offset;
 
    =     return count; =
 
--_000_401E54CE964CD94BAE1EB4A729C7087E1229036B69HQMAIL04nvidi_-- -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: email@kvack.org