aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhen Lei <thunder.leizhen@huawei.com>2015-06-26 09:32:58 +0100
committerAlex Shi <alex.shi@linaro.org>2016-04-18 14:40:07 +0800
commit9ba251cf26970f4fd5596ae2d0a3ca04446118f7 (patch)
treea6d37dbf481f676ef3f182921ad4367d6d8d6aac
parentdd7b9ddaacd89de509fa99fc10599c0c712fb467 (diff)
iommu/arm-smmu: Fix the index calculation of strtab
The element size of cfg->strtab is just one DWORD, so we should use a multiply operation instead of a shift when calculating the level 1 index. Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com> Signed-off-by: Will Deacon <will.deacon@arm.com> (cherry picked from commit 69146e7bfc38139a134c79a4ee6607c881891786) Signed-off-by: Alex Shi <alex.shi@linaro.org>
-rw-r--r--drivers/iommu/arm-smmu-v3.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c
index 8e9ec81ce4bb..606852f18808 100644
--- a/drivers/iommu/arm-smmu-v3.c
+++ b/drivers/iommu/arm-smmu-v3.c
@@ -1064,7 +1064,7 @@ static int arm_smmu_init_l2_strtab(struct arm_smmu_device *smmu, u32 sid)
return 0;
size = 1 << (STRTAB_SPLIT + ilog2(STRTAB_STE_DWORDS) + 3);
- strtab = &cfg->strtab[sid >> STRTAB_SPLIT << STRTAB_L1_DESC_DWORDS];
+ strtab = &cfg->strtab[(sid >> STRTAB_SPLIT) * STRTAB_L1_DESC_DWORDS];
desc->span = STRTAB_SPLIT + 1;
desc->l2ptr = dma_zalloc_coherent(smmu->dev, size, &desc->l2ptr_dma,