]> Pileus Git - ~andy/linux/commitdiff
iommu/arm-smmu: don't enable SMMU device until probing has completed
authorWill Deacon <will.deacon@arm.com>
Wed, 21 Aug 2013 12:56:34 +0000 (13:56 +0100)
committerWill Deacon <will.deacon@arm.com>
Tue, 17 Sep 2013 11:03:11 +0000 (12:03 +0100)
We currently reset and enable the SMMU before the device has finished
being probed, so if we fail later on (for example, because we couldn't
request a global irq successfully) then we will leave the device in an
active state.

This patch delays the reset and enabling of the SMMU hardware until
probing has completed.

Cc: <stable@vger.kernel.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
drivers/iommu/arm-smmu.c

index 913bd1565e4185c82fd93b932236f64dbb348b4d..181c9ba929cdfa131123639862cdefb2587c8cf6 100644 (file)
@@ -1858,8 +1858,6 @@ static int arm_smmu_device_dt_probe(struct platform_device *pdev)
                goto out_put_parent;
        }
 
-       arm_smmu_device_reset(smmu);
-
        for (i = 0; i < smmu->num_global_irqs; ++i) {
                err = request_irq(smmu->irqs[i],
                                  arm_smmu_global_fault,
@@ -1877,6 +1875,8 @@ static int arm_smmu_device_dt_probe(struct platform_device *pdev)
        spin_lock(&arm_smmu_devices_lock);
        list_add(&smmu->list, &arm_smmu_devices);
        spin_unlock(&arm_smmu_devices_lock);
+
+       arm_smmu_device_reset(smmu);
        return 0;
 
 out_free_irqs: