From d140862b4d63a35e3452c880b8d14dbd6c82fb8e Mon Sep 17 00:00:00 2001 From: Hiroshi Doyu Date: Mon, 4 Mar 2013 15:41:35 +0200 Subject: iommu/tegra: smmu: Remove SKIP_SWGRP_CHECK Remove obsolete workaround, SKIP_SWGRP_CHECK. bug 1286500 Change-Id: I2986a33af1304973a2c30e57f7790dd70729f566 (cherry picked from commit 7de038bc039ba1106580fea174a4b74805fea412) Signed-off-by: Hiroshi Doyu Reviewed-on: http://git-master/r/234116 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Krishna Reddy --- drivers/iommu/tegra-smmu.c | 34 ++++------------------------------ 1 file changed, 4 insertions(+), 30 deletions(-) diff --git a/drivers/iommu/tegra-smmu.c b/drivers/iommu/tegra-smmu.c index cb650a21b360..50d51e1ffd52 100644 --- a/drivers/iommu/tegra-smmu.c +++ b/drivers/iommu/tegra-smmu.c @@ -43,9 +43,6 @@ #include #include -/* REVISIT: With new configurations for t114/124/148 passed from DT */ -#define SKIP_SWGRP_CHECK - /* bitmap of the page sizes currently supported */ #define SMMU_IOMMU_PGSIZES (SZ_4K | SZ_4M) @@ -327,25 +324,11 @@ static int __smmu_client_set_hwgrp(struct smmu_client *c, u64 map, int on) offs = HWGRP_ASID_REG(i); val = smmu_read(smmu, offs); - if (on) { -#if !defined(SKIP_SWGRP_CHECK) - if (WARN_ON(val & mask)) { - for_each_set_bit(i, &map, HWGRP_COUNT) { - offs = HWGRP_ASID_REG(i); - val = smmu_read(smmu, offs); - val &= ~mask; - smmu_write(smmu, val, offs); - } - return -EBUSY; - } -#endif + if (on) val |= mask; -#if !defined(SKIP_SWGRP_CHECK) - } else { - WARN_ON((val & mask) == mask); + else val &= ~mask; -#endif - } + smmu_write(smmu, val, offs); } FLUSH_SMMU_REGS(smmu); @@ -795,7 +778,7 @@ static int smmu_iommu_attach_dev(struct iommu_domain *domain, struct smmu_as *as = domain->priv; struct smmu_device *smmu = as->smmu; struct smmu_client *client, *c; - u32 map; + u64 map = smmu->swgids; int err; client = devm_kzalloc(smmu->dev, sizeof(*c), GFP_KERNEL); @@ -804,15 +787,6 @@ static int smmu_iommu_attach_dev(struct iommu_domain *domain, client->dev = dev; client->as = as; -#ifdef SKIP_SWGRP_CHECK - /* Enable all SWGRP blindly by default */ - map = ~0UL; -#else - map = (unsigned long)dev->platform_data; - if (!map) - return -EINVAL; -#endif - err = smmu_client_enable_hwgrp(client, map); if (err) goto err_hwgrp; -- cgit v1.2.3