iommu/io-pgtable-arm: Fix iova_to_phys for block entries
[cascardo/linux.git] / drivers / iommu / io-pgtable-arm.c
index a1ed1b7..f5c90e1 100644 (file)
@@ -576,7 +576,7 @@ static phys_addr_t arm_lpae_iova_to_phys(struct io_pgtable_ops *ops,
        return 0;
 
 found_translation:
-       iova &= (ARM_LPAE_GRANULE(data) - 1);
+       iova &= (ARM_LPAE_BLOCK_SIZE(lvl, data) - 1);
        return ((phys_addr_t)iopte_to_pfn(pte,data) << data->pg_shift) | iova;
 }