Merge tag 'iommu-updates-v6.10' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux-2.6-block.git] / drivers / iommu / arm / arm-smmu / arm-smmu.c
index c572d877b0e102cb05e751d8872e105afa6f3541..87c81f75cf844bd58492091bede23a1f2cb867ee 100644 (file)
@@ -806,8 +806,16 @@ static int arm_smmu_init_domain_context(struct arm_smmu_domain *smmu_domain,
        else
                context_fault = arm_smmu_context_fault;
 
-       ret = devm_request_irq(smmu->dev, irq, context_fault, IRQF_SHARED,
-                              "arm-smmu-context-fault", smmu_domain);
+       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);
@@ -859,14 +867,10 @@ static void arm_smmu_destroy_domain_context(struct arm_smmu_domain *smmu_domain)
        arm_smmu_rpm_put(smmu);
 }
 
-static struct iommu_domain *arm_smmu_domain_alloc(unsigned type)
+static struct iommu_domain *arm_smmu_domain_alloc_paging(struct device *dev)
 {
        struct arm_smmu_domain *smmu_domain;
 
-       if (type != IOMMU_DOMAIN_UNMANAGED) {
-               if (using_legacy_binding || type != IOMMU_DOMAIN_DMA)
-                       return NULL;
-       }
        /*
         * Allocate the domain and initialise some of its data structures.
         * We can't really do anything meaningful until we've added a
@@ -1596,7 +1600,7 @@ static struct iommu_ops arm_smmu_ops = {
        .identity_domain        = &arm_smmu_identity_domain,
        .blocked_domain         = &arm_smmu_blocked_domain,
        .capable                = arm_smmu_capable,
-       .domain_alloc           = arm_smmu_domain_alloc,
+       .domain_alloc_paging    = arm_smmu_domain_alloc_paging,
        .probe_device           = arm_smmu_probe_device,
        .release_device         = arm_smmu_release_device,
        .probe_finalize         = arm_smmu_probe_finalize,