diff options
-rw-r--r-- | drivers/iommu/Makefile | 2 | ||||
-rw-r--r-- | drivers/iommu/tegra-smmu.c | 19 |
2 files changed, 11 insertions, 10 deletions
diff --git a/drivers/iommu/Makefile b/drivers/iommu/Makefile index 7ad7a3bc1242..ed59619d1af8 100644 --- a/drivers/iommu/Makefile +++ b/drivers/iommu/Makefile @@ -8,5 +8,7 @@ obj-$(CONFIG_IRQ_REMAP) += intr_remapping.o obj-$(CONFIG_OMAP_IOMMU) += omap-iommu.o obj-$(CONFIG_OMAP_IOVMM) += omap-iovmm.o obj-$(CONFIG_OMAP_IOMMU_DEBUG) += omap-iommu-debug.o +CFLAGS_tegra-gart.o = -Werror obj-$(CONFIG_TEGRA_IOMMU_GART) += tegra-gart.o +CFLAGS_tegra-smmu.o = -Werror obj-$(CONFIG_TEGRA_IOMMU_SMMU) += tegra-smmu.o 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) |