Commit 960be6e1 authored by Georgi Djakov's avatar Georgi Djakov Committed by Will Deacon
Browse files

iommu/arm-smmu: Allow using a threaded handler for context interrupts



Threaded IRQ handlers run in a less critical context compared to normal
IRQs, so they can perform more complex and time-consuming operations
without causing significant delays in other parts of the kernel.
During a context fault, it might be needed to do more processing and
gather debug information from TBUs in the handler. These operations may
sleep, so add an option to use a threaded IRQ handler in these cases.

Signed-off-by: default avatarGeorgi Djakov <quic_c_gdjako@quicinc.com>
Link: https://lore.kernel.org/r/20240417133731.2055383-4-quic_c_gdjako@quicinc.com


Signed-off-by: default avatarWill Deacon <will@kernel.org>
parent 414ecb03
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -806,8 +806,16 @@ static int arm_smmu_init_domain_context(struct arm_smmu_domain *smmu_domain,
	else
		context_fault = arm_smmu_context_fault;

	if (smmu->impl && smmu->impl->context_fault_needs_threaded_irq)
		ret = devm_request_threaded_irq(smmu->dev, irq, NULL,
						context_fault,
						IRQF_ONESHOT | IRQF_SHARED,
						"arm-smmu-context-fault",
						smmu_domain);
	else
		ret = devm_request_irq(smmu->dev, irq, context_fault, IRQF_SHARED,
				       "arm-smmu-context-fault", smmu_domain);

	if (ret < 0) {
		dev_err(smmu->dev, "failed to request context IRQ %d (%u)\n",
			cfg->irptndx, irq);
+1 −0
Original line number Diff line number Diff line
@@ -438,6 +438,7 @@ struct arm_smmu_impl {
	int (*def_domain_type)(struct device *dev);
	irqreturn_t (*global_fault)(int irq, void *dev);
	irqreturn_t (*context_fault)(int irq, void *dev);
	bool context_fault_needs_threaded_irq;
	int (*alloc_context_bank)(struct arm_smmu_domain *smmu_domain,
				  struct arm_smmu_device *smmu,
				  struct device *dev, int start);