[PATCH 09/12] iommu: qcom_iommu: allow faulting transactions to terminate

From: Dmitry Baryshkov

Date: Sun Aug 09 2026 - 16:17:41 EST


Context banks are programmed with SCTLR.CFCFG, which selects the stall
model: rather than terminating, a faulting transaction is held pending a
write to CB_RESUME. Held transactions stop the micro-MMU draining, and
anything that waits for the front-end to quiesce - the halt handshake, and
TLBSYNC - waits on exactly that.

Not every instance wants the stall model, and some cannot tolerate it.
Add a per-instance no_stall flag that clears CFCFG so faults terminate
instead. CFRE and CFIE are untouched, so faults are still reported
through the existing interrupt handler; only the stall goes away, and
with it the handler's RESUME write becomes a formality.

No instance sets the flag yet.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@xxxxxxxxxxxxxxxx>
---
drivers/iommu/arm/arm-smmu/qcom_iommu.c | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/drivers/iommu/arm/arm-smmu/qcom_iommu.c b/drivers/iommu/arm/arm-smmu/qcom_iommu.c
index f27f8722ee64..2b2cf665c39d 100644
--- a/drivers/iommu/arm/arm-smmu/qcom_iommu.c
+++ b/drivers/iommu/arm/arm-smmu/qcom_iommu.c
@@ -76,6 +76,8 @@ struct qcom_iommu_cfg {
bool ctx_restore;
/* the micro-MMU must be halted while its registers are programmed */
bool halt;
+ /* faulting transactions must terminate rather than stall */
+ bool no_stall;
const struct qcom_iommu_sid *sids; /* one SMR slot per entry */
unsigned int num_sids;
};
@@ -500,6 +502,9 @@ static int qcom_iommu_init_domain(struct iommu_domain *domain,
if (qcom_iommu->cfg && qcom_iommu->cfg->no_afe)
reg &= ~ARM_SMMU_SCTLR_AFE;

+ if (qcom_iommu->cfg && qcom_iommu->cfg->no_stall)
+ reg &= ~ARM_SMMU_SCTLR_CFCFG;
+
ctx->sctlr = reg;

qcom_iommu_program_ctx(qcom_iommu, ctx);

--
2.47.3