drm/msm: Use correct type for physical addresses
authorArchit Taneja <architt@codeaurora.org>
Sun, 17 Apr 2016 14:58:43 +0000 (20:28 +0530)
committerRob Clark <robdclark@gmail.com>
Sat, 16 Jul 2016 14:08:34 +0000 (10:08 -0400)
The u32 type used to pass the physical addresses to iommu_map can't
accommodate 64 bit addresses. Move to dma_addr_t to ensure wrong
addresses aren't provided to the IOMMU driver.

Signed-off-by: Archit Taneja <architt@codeaurora.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
drivers/gpu/drm/msm/msm_iommu.c

index a7a0b6d9b057c88a849a4a80ed86e30adb3fb6b4..3bc8fd327eed16240bc04c1a2addb9d6ac832889 100644 (file)
@@ -59,10 +59,10 @@ static int msm_iommu_map(struct msm_mmu *mmu, uint32_t iova,
                return -EINVAL;
 
        for_each_sg(sgt->sgl, sg, sgt->nents, i) {
-               u32 pa = sg_phys(sg) - sg->offset;
+               dma_addr_t pa = sg_phys(sg) - sg->offset;
                size_t bytes = sg->length + sg->offset;
 
-               VERB("map[%d]: %08x %08x(%zx)", i, iova, pa, bytes);
+               VERB("map[%d]: %08x %08lx(%zx)", i, iova, (unsigned long)pa, bytes);
 
                ret = iommu_map(domain, da, pa, bytes, prot);
                if (ret)