Merge tag 'iommu-updates-v4.19' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux-block.git] / drivers / iommu / arm-smmu.c
index c73cfce1ccc0aede67eadba8525825e48f553941..fd1b80ef9490d2f4044f0704e9ebc5843d21b2bf 100644 (file)
@@ -1562,7 +1562,6 @@ static struct iommu_ops arm_smmu_ops = {
        .attach_dev             = arm_smmu_attach_dev,
        .map                    = arm_smmu_map,
        .unmap                  = arm_smmu_unmap,
-       .map_sg                 = default_iommu_map_sg,
        .flush_iotlb_all        = arm_smmu_iotlb_sync,
        .iotlb_sync             = arm_smmu_iotlb_sync,
        .iova_to_phys           = arm_smmu_iova_to_phys,
@@ -2103,12 +2102,16 @@ static int arm_smmu_device_probe(struct platform_device *pdev)
        if (err)
                return err;
 
-       if (smmu->version == ARM_SMMU_V2 &&
-           smmu->num_context_banks != smmu->num_context_irqs) {
-               dev_err(dev,
-                       "found only %d context interrupt(s) but %d required\n",
-                       smmu->num_context_irqs, smmu->num_context_banks);
-               return -ENODEV;
+       if (smmu->version == ARM_SMMU_V2) {
+               if (smmu->num_context_banks > smmu->num_context_irqs) {
+                       dev_err(dev,
+                             "found only %d context irq(s) but %d required\n",
+                             smmu->num_context_irqs, smmu->num_context_banks);
+                       return -ENODEV;
+               }
+
+               /* Ignore superfluous interrupts */
+               smmu->num_context_irqs = smmu->num_context_banks;
        }
 
        for (i = 0; i < smmu->num_global_irqs; ++i) {