OSDN Git Service

iommu/arm-smmu: Don't wipe out MICRO_MMU_CTRL while halting
authorMitchel Humpherys <mitchelh@codeaurora.org>
Tue, 22 Sep 2015 18:52:53 +0000 (11:52 -0700)
committerDavid Keitel <dkeitel@codeaurora.org>
Tue, 22 Mar 2016 18:14:16 +0000 (11:14 -0700)
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 <mitchelh@codeaurora.org>
drivers/iommu/arm-smmu.c

index 9d8c7dc..4f9a8c5 100644 (file)
@@ -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;
 }