iommu/arm-smmu-v3: Implement shutdown method
authorNate Watterson <nwatters@codeaurora.org>
Thu, 29 Jun 2017 22:18:15 +0000 (18:18 -0400)
committerWill Deacon <will.deacon@arm.com>
Wed, 16 Aug 2017 16:27:28 +0000 (17:27 +0100)
The shutdown method disables the SMMU to avoid corrupting a new kernel
started with kexec.

Signed-off-by: Nate Watterson <nwatters@codeaurora.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
drivers/iommu/arm-smmu-v3.c
drivers/iommu/arm-smmu.c

index 568c400..e67ba6c 100644 (file)
@@ -2852,9 +2852,15 @@ static int arm_smmu_device_remove(struct platform_device *pdev)
        struct arm_smmu_device *smmu = platform_get_drvdata(pdev);
 
        arm_smmu_device_disable(smmu);
+
        return 0;
 }
 
+static void arm_smmu_device_shutdown(struct platform_device *pdev)
+{
+       arm_smmu_device_remove(pdev);
+}
+
 static const struct of_device_id arm_smmu_of_match[] = {
        { .compatible = "arm,smmu-v3", },
        { },
@@ -2868,6 +2874,7 @@ static struct platform_driver arm_smmu_driver = {
        },
        .probe  = arm_smmu_device_probe,
        .remove = arm_smmu_device_remove,
+       .shutdown = arm_smmu_device_shutdown,
 };
 module_platform_driver(arm_smmu_driver);
 
index b97188a..b0b126e 100644 (file)
@@ -2329,6 +2329,11 @@ static int arm_smmu_device_remove(struct platform_device *pdev)
        return 0;
 }
 
+static void arm_smmu_device_shutdown(struct platform_device *pdev)
+{
+       arm_smmu_device_remove(pdev);
+}
+
 static struct platform_driver arm_smmu_driver = {
        .driver = {
                .name           = "arm-smmu",
@@ -2336,6 +2341,7 @@ static struct platform_driver arm_smmu_driver = {
        },
        .probe  = arm_smmu_device_probe,
        .remove = arm_smmu_device_remove,
+       .shutdown = arm_smmu_device_shutdown,
 };
 module_platform_driver(arm_smmu_driver);