lkml.org 
[lkml]   [2020]   [Sep]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 4/8] iommu/arm-smmu: Support test_smr_masks implementation detail deviation
Date
From: AngeloGioacchino Del Regno <kholk11@gmail.com>

At least some Qualcomm SoCs do need to override the function
arm_smmu_test_smr_masks entirely: add a test_smr_masks function
to the implementation details structure and call it properly.

Signed-off-by: AngeloGioacchino Del Regno <kholk11@gmail.com>
---
drivers/iommu/arm/arm-smmu/arm-smmu.c | 6 ++++++
drivers/iommu/arm/arm-smmu/arm-smmu.h | 1 +
2 files changed, 7 insertions(+)

diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu.c b/drivers/iommu/arm/arm-smmu/arm-smmu.c
index 09c42af9f31e..446a78dde9cd 100644
--- a/drivers/iommu/arm/arm-smmu/arm-smmu.c
+++ b/drivers/iommu/arm/arm-smmu/arm-smmu.c
@@ -977,6 +977,12 @@ static void arm_smmu_test_smr_masks(struct arm_smmu_device *smmu)

if (!smmu->smrs)
return;
+
+ if (smmu->impl && smmu->impl->test_smr_masks) {
+ smmu->impl->test_smr_masks(smmu);
+ return;
+ }
+
/*
* If we've had to accommodate firmware memory regions, we may
* have live SMRs by now; tread carefully...
diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu.h b/drivers/iommu/arm/arm-smmu/arm-smmu.h
index d890a4a968e8..2cd3d126f675 100644
--- a/drivers/iommu/arm/arm-smmu/arm-smmu.h
+++ b/drivers/iommu/arm/arm-smmu/arm-smmu.h
@@ -387,6 +387,7 @@ struct arm_smmu_impl {
int (*cfg_probe)(struct arm_smmu_device *smmu);
int (*reset)(struct arm_smmu_device *smmu);
int (*init_context)(struct arm_smmu_domain *smmu_domain);
+ void (*test_smr_masks)(struct arm_smmu_device *smmu);
void (*tlb_sync)(struct arm_smmu_device *smmu, int page, int sync,
int status);
int (*def_domain_type)(struct device *dev);
--
2.28.0
\
 
 \ /
  Last update: 2020-09-26 15:01    [W:0.111 / U:0.096 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site