arm: dma-mapping: fix incorrect phys address in trace message
Krishna Reddy [Thu, 3 Apr 2014 17:40:21 +0000 (10:40 -0700)]
Fix incorrect phys address printed in trace message in
arm_coherent_iommu_unmap_page(). iommu_iova_to_phys() is
called after unmap iova in arm_coherent_iommu_unmap_page().
This causes invalid phys address printed in trace message.

Change-Id: I94acbfc9ef6f25c765ed3057b474596c8f12c6dc
Signed-off-by: Krishna Reddy <vdumpa@nvidia.com>
Reviewed-on: http://git-master/r/391952
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alex Waterman <alexw@nvidia.com>

arch/arm/mm/dma-mapping.c

index 08f6888..e4b0e52 100644 (file)
@@ -2141,12 +2141,11 @@ static void arm_coherent_iommu_unmap_page(struct device *dev, dma_addr_t handle,
        if (!iova)
                return;
 
+       trace_dmadebug_unmap_page(dev, handle, size,
+                 phys_to_page(iommu_iova_to_phys(mapping->domain, handle)));
        pg_iommu_unmap(mapping->domain, iova, len, (int)attrs);
        if (!dma_get_attr(DMA_ATTR_SKIP_FREE_IOVA, attrs))
                __free_iova(mapping, iova, len, attrs);
-
-       trace_dmadebug_unmap_page(dev, handle, size,
-                 phys_to_page(iommu_iova_to_phys(mapping->domain, handle)));
 }
 
 /**