[3.13.y.z extended stable] Patch "iommu/arm-smmu: fix programming of SMMU_CBn_TCR for stage 1" has been added to staging queue

Kamal Mostafa kamal at canonical.com
Wed Oct 8 22:14:01 UTC 2014

This is a note to let you know that I have just added a patch titled

    iommu/arm-smmu: fix programming of SMMU_CBn_TCR for stage 1

to the linux-3.13.y-queue branch of the 3.13.y.z extended stable tree 
which can be found at:


This patch is scheduled to be released in version

If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.13.y.z tree, see



>From 8a210e06b91a8a6c2335b824fccda066158b9677 Mon Sep 17 00:00:00 2001
From: Olav Haugan <ohaugan at codeaurora.org>
Date: Mon, 4 Aug 2014 19:01:02 +0100
Subject: iommu/arm-smmu: fix programming of SMMU_CBn_TCR for stage 1

commit 1fc870c7efa364862c3bc792cfbdb38afea26742 upstream.

Stage-1 context banks do not have the SMMU_CBn_TCR[SL0] field since it
is only applicable to stage-2 context banks.

This patch ensures that we don't set the reserved TCR bits for stage-1

Signed-off-by: Olav Haugan <ohaugan at codeaurora.org>
Signed-off-by: Will Deacon <will.deacon at arm.com>
Signed-off-by: Kamal Mostafa <kamal at canonical.com>
 drivers/iommu/arm-smmu.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c
index 0d3e4e6..91739bf 100644
--- a/drivers/iommu/arm-smmu.c
+++ b/drivers/iommu/arm-smmu.c
@@ -793,8 +793,11 @@ static void arm_smmu_init_context_bank(struct arm_smmu_domain *smmu_domain)
 	reg |= TTBCR_EAE |
 	      (TTBCR_SH_IS << TTBCR_SH0_SHIFT) |
-	      (TTBCR_SL0_LVL_1 << TTBCR_SL0_SHIFT);
+	if (!stage1)
+		reg |= (TTBCR_SL0_LVL_1 << TTBCR_SL0_SHIFT);
 	writel_relaxed(reg, cb_base + ARM_SMMU_CB_TTBCR);

 	/* MAIR0 (stage-1 only) */

More information about the kernel-team mailing list