Re: [PATCH v6 4/7] iommu/arm-smmu-qcom: Use a custom context fault handler for sdm845

From: Konrad Dybcio
Date: Tue Mar 12 2024 - 14:15:12 EST




On 3/7/24 20:05, Georgi Djakov wrote:
The sdm845 platform now supports TBUs, so let's get additional debug
info from the TBUs when a context fault occurs. Implement a custom
context fault handler that does both software + hardware page table
walks and TLB Invalidate All.

Signed-off-by: Georgi Djakov <quic_c_gdjako@xxxxxxxxxxx>
---

[...]

diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c b/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c
index 5c7cfc51b57c..7a58b1b96bca 100644
--- a/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c
+++ b/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c
@@ -422,6 +422,10 @@ static const struct arm_smmu_impl sdm845_smmu_500_impl = {
.reset = qcom_sdm845_smmu500_reset,
.write_s2cr = qcom_smmu_write_s2cr,
.tlb_sync = qcom_smmu_tlb_sync,
+#ifdef CONFIG_ARM_SMMU_QCOM_TBU
+ .context_fault = qcom_smmu_context_fault,
+ .context_fault_needs_threaded_irq = true,
+#endif

Is this enough for cases where CONFIG_ARM_SMMU_QCOM_TBU=y but the
dts changes aren't there? IIUC this will spam the error message in
qcom_find_tbu()

Konrad