From 5cb23de54d39b1986ce18798adc455ae27527cf9 Mon Sep 17 00:00:00 2001 From: Mitchel Humpherys Date: Tue, 22 Sep 2015 11:52:53 -0700 Subject: [PATCH] iommu/arm-smmu: Don't wipe out MICRO_MMU_CTRL while halting The MICRO_MMU_CTRL register is used for halt control, but it also contains some important configuration bits. Currently, when we request a halt, we're wiping out all of the other bits in the register, losing any previous configuration. Fix this by reading the value and OR'ing in the bits we need. Change-Id: Iafdc5b2a344916dce9bac7f958a153dbee042ca8 Signed-off-by: Mitchel Humpherys --- drivers/iommu/arm-smmu.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c index 9d8c7dc4de7a..4f9a8c5e6b8b 100644 --- a/drivers/iommu/arm-smmu.c +++ b/drivers/iommu/arm-smmu.c @@ -2244,10 +2244,12 @@ static int arm_smmu_wait_for_halt(struct arm_smmu_device *smmu) static int __arm_smmu_halt(struct arm_smmu_device *smmu, bool wait) { + u32 reg; void __iomem *impl_def1_base = ARM_SMMU_IMPL_DEF1(smmu); - writel_relaxed(MICRO_MMU_CTRL_LOCAL_HALT_REQ, - impl_def1_base + IMPL_DEF1_MICRO_MMU_CTRL); + reg = readl_relaxed(impl_def1_base + IMPL_DEF1_MICRO_MMU_CTRL); + reg |= MICRO_MMU_CTRL_LOCAL_HALT_REQ; + writel_relaxed(reg, impl_def1_base + IMPL_DEF1_MICRO_MMU_CTRL); return wait ? arm_smmu_wait_for_halt(smmu) : 0; } -- 2.11.0