From 1babe09d54b5b71c2797b5c7aaa7579fdfeef84d Mon Sep 17 00:00:00 2001 From: Liam Mark Date: Fri, 31 Jan 2020 13:33:49 -0800 Subject: [PATCH] iommu/arm-smmu: Use an atomic context when fastmap is set on GKI By default fastmap uses an atomic context. On GKI builds fastmap is not supported, but we need to ensure that when a client requests that fastmap be enabled on a GKI build that they still use an atomic context. Change-Id: I145e4679e973b10f666a0bef6ba104223fa5e7a9 Signed-off-by: Liam Mark --- drivers/iommu/arm-smmu.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c index eeb8728432e0..13c6c8dd7f26 100644 --- a/drivers/iommu/arm-smmu.c +++ b/drivers/iommu/arm-smmu.c @@ -2645,16 +2645,19 @@ static int arm_smmu_setup_default_domain(struct device *dev, if (ret) str = "default"; - if (!strcmp(str, "bypass")) + if (!strcmp(str, "bypass")) { __arm_smmu_domain_set_attr( domain, DOMAIN_ATTR_S1_BYPASS, &attr); - else if (!strcmp(str, "fastmap")) - __arm_smmu_domain_set_attr( - domain, DOMAIN_ATTR_FAST, &attr); - else if (!strcmp(str, "atomic")) + } else if (!strcmp(str, "fastmap")) { + /* Ensure DOMAIN_ATTR_ATOMIC is set for GKI */ __arm_smmu_domain_set_attr( domain, DOMAIN_ATTR_ATOMIC, &attr); - else if (!strcmp(str, "disabled")) { + __arm_smmu_domain_set_attr( + domain, DOMAIN_ATTR_FAST, &attr); + } else if (!strcmp(str, "atomic")) { + __arm_smmu_domain_set_attr( + domain, DOMAIN_ATTR_ATOMIC, &attr); + } else if (!strcmp(str, "disabled")) { /* * Don't touch hw, and don't allocate irqs or other resources. * Ensure the context bank is set to a valid value per dynamic