diff options
Diffstat (limited to 'drivers/iommu/tegra-smmu.c')
-rw-r--r-- | drivers/iommu/tegra-smmu.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/drivers/iommu/tegra-smmu.c b/drivers/iommu/tegra-smmu.c index 7b5ef3ffb7d0..25bff5c02bb4 100644 --- a/drivers/iommu/tegra-smmu.c +++ b/drivers/iommu/tegra-smmu.c @@ -320,8 +320,15 @@ static int __smmu_client_set_hwgrp(struct smmu_client *c, val = smmu_read(smmu, offs); if (on) { #if !defined(SKIP_SWGRP_CHECK) - if (WARN_ON(val & mask)) - goto err_hw_busy; + 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 val |= mask; } else { @@ -336,14 +343,6 @@ static int __smmu_client_set_hwgrp(struct smmu_client *c, c->hwgrp = map; return 0; -err_hw_busy: - 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; } static int smmu_client_set_hwgrp(struct smmu_client *c, u32 map, int on) |