summaryrefslogtreecommitdiff
path: root/drivers/iommu
diff options
context:
space:
mode:
authorKrishna Reddy <vdumpa@nvidia.com>2013-12-17 16:43:37 -0800
committerKrishna Reddy <vdumpa@nvidia.com>2013-12-18 09:35:17 -0800
commit6d6ee8e07b95793e6620146cff4c40d6c36134df (patch)
treefa1be8224ae6a144d30b703905363b6b0b31f0c7 /drivers/iommu
parent4b8c08fb5e41a8a33294762a2f40edf268360cc7 (diff)
iommu/tegra: smmu: clear asid field correct
Clear asid field correctly based on number of asids supported. Bug 1380855 Change-Id: I2d0e7ab6b4fe01715156248aba257cdfb96e38b3 Signed-off-by: Krishna Reddy <vdumpa@nvidia.com> Reviewed-on: http://git-master/r/346737 Reviewed-by: Automatic_Commit_Validation_User
Diffstat (limited to 'drivers/iommu')
-rw-r--r--drivers/iommu/tegra-smmu.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/iommu/tegra-smmu.c b/drivers/iommu/tegra-smmu.c
index c91767b175f6..0495d4411d04 100644
--- a/drivers/iommu/tegra-smmu.c
+++ b/drivers/iommu/tegra-smmu.c
@@ -103,6 +103,7 @@ enum {
#define SMMU_TLB_FLUSH_ASID_SHIFT(as) \
(SMMU_TLB_FLUSH_ASID_SHIFT_BASE - __ffs((as)->smmu->num_as))
+#define SMMU_ASID_MASK ((1 << __ffs((as)->smmu->num_as)) - 1)
#define SMMU_PTC_FLUSH 0x34
#define SMMU_PTC_FLUSH_TYPE_ALL 0
@@ -488,7 +489,7 @@ static int __smmu_client_set_hwgrp(struct smmu_client *c, u64 map, int on)
offs = tegra_smmu_get_offset(i);
val = smmu_read(smmu, offs);
- val &= ~3; /* always overwrite ASID */
+ val &= ~SMMU_ASID_MASK; /* always overwrite ASID */
if (on)
val |= mask;
@@ -500,8 +501,8 @@ static int __smmu_client_set_hwgrp(struct smmu_client *c, u64 map, int on)
smmu_write(smmu, val, offs);
dev_dbg(c->dev, "swgid:%d asid:%d %s @%s\n",
- i, val & 3, (val & BIT(31)) ? "Enabled" : "Disabled",
- __func__);
+ i, val & SMMU_ASID_MASK,
+ (val & BIT(31)) ? "Enabled" : "Disabled", __func__);
}
FLUSH_SMMU_REGS(smmu);
c->swgids = map;