]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
ARM: mm: Remove dependency on mapping's alignment
authorSri Krishna chowdary <schowdary@nvidia.com>
Tue, 26 Aug 2014 09:04:50 +0000 (14:34 +0530)
committerSri Krishna Chowdary <schowdary@nvidia.com>
Wed, 27 Aug 2014 06:21:14 +0000 (23:21 -0700)
Do not rely on mapping's alignment to decide whether to
use DMA_ATTR_SKIP_IOVA_GAP or not, instead, give priority
to DMA_SKIP_IOVA_GAP always.

This patch confirms if the dma paths which are not using
DMA_ATTR_SKIP_IOVA_GAP are still sane.

Bug 1463797

Change-Id: I3cee5d5ab5c63ea61a4ffcbd3c9f745d68d7e6af
Signed-off-by: Sri Krishna chowdary <schowdary@nvidia.com>
Reviewed-on: http://git-master/r/488091
GVS: Gerrit_Virtual_Submit
Reviewed-by: Hiroshi Doyu <hdoyu@nvidia.com>
arch/arm/mm/dma-mapping.c
arch/arm64/mm/dma-mapping.c

index e713b66ee2c41533c5a61dcaad5658ab817c3d38..ab029a8134b0c0d525195fc9fb480ee5782406d3 100644 (file)
@@ -1185,15 +1185,9 @@ static inline int iommu_get_num_pf_pages(struct dma_iommu_mapping *mapping,
 {
        int count = 0;
 
-       /*
-        * XXX: assume alignment property's presence <=> prefetch and gap
-        * properties are correctly filled
-        */
-       if (!mapping->alignment) {
-               if (!dma_get_attr(DMA_ATTR_SKIP_IOVA_GAP, attrs))
-                       return PG_PAGES;
-               return 0;
-       }
+       /* XXX: give priority to DMA_ATTR_SKIP_IOVA_GAP */
+       if (dma_get_attr(DMA_ATTR_SKIP_IOVA_GAP, attrs))
+                       return 0;
 
        /* XXX: currently we support only 1 prefetch page */
        WARN_ON(mapping->num_pf_page > prefetch_page_count);
index f0f4ad8f2664462b3e8ec7e1a48ea8c733479120..537295ec34ad649ccce753c7ff37a9cacdcbc26b 100644 (file)
@@ -1234,15 +1234,9 @@ static inline int iommu_get_num_pf_pages(struct dma_iommu_mapping *mapping,
 {
        int count = 0;
 
-       /*
-        * XXX: assume alignment property's presence <=> prefetch and gap
-        * properties are correctly filled
-        */
-       if (!mapping->alignment) {
-               if (!dma_get_attr(DMA_ATTR_SKIP_IOVA_GAP, attrs))
-                       return PG_PAGES;
+       /* XXX: give priority to DMA_ATTR_SKIP_IOVA_GAP */
+       if (dma_get_attr(DMA_ATTR_SKIP_IOVA_GAP, attrs))
                return 0;
-       }
 
        /* XXX: currently we support only 1 prefetch page */
        WARN_ON(mapping->num_pf_page > prefetch_page_count);