Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c81b55a7 authored by Mitchel Humpherys's avatar Mitchel Humpherys
Browse files

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: default avatarMitchel Humpherys <mitchelh@codeaurora.org>
parent e7c95927
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -2243,10 +2243,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;
}