* [PATCH] iommu/arm-smmu: Add missing pm_runtime_disable() in qcom_iommu_device_probe
@ 2022-01-05 10:16 Miaoqian Lin
2022-02-08 16:21 ` Will Deacon
0 siblings, 1 reply; 2+ messages in thread
From: Miaoqian Lin @ 2022-01-05 10:16 UTC (permalink / raw)
Cc: linmq006, Rob Clark, Will Deacon, Robin Murphy, Joerg Roedel,
iommu, linux-arm-msm, linux-arm-kernel, linux-kernel
If the probe fails, we should use pm_runtime_disable() to balance
pm_runtime_enable().
Add missing pm_runtime_disable() for error handling.
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
---
drivers/iommu/arm/arm-smmu/qcom_iommu.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/iommu/arm/arm-smmu/qcom_iommu.c b/drivers/iommu/arm/arm-smmu/qcom_iommu.c
index b91874cb6cf3..2f227bc88bd9 100644
--- a/drivers/iommu/arm/arm-smmu/qcom_iommu.c
+++ b/drivers/iommu/arm/arm-smmu/qcom_iommu.c
@@ -827,20 +827,20 @@ static int qcom_iommu_device_probe(struct platform_device *pdev)
ret = devm_of_platform_populate(dev);
if (ret) {
dev_err(dev, "Failed to populate iommu contexts\n");
- return ret;
+ goto err_pm_disable;
}
ret = iommu_device_sysfs_add(&qcom_iommu->iommu, dev, NULL,
dev_name(dev));
if (ret) {
dev_err(dev, "Failed to register iommu in sysfs\n");
- return ret;
+ goto err_pm_disable;
}
ret = iommu_device_register(&qcom_iommu->iommu, &qcom_iommu_ops, dev);
if (ret) {
dev_err(dev, "Failed to register iommu\n");
- return ret;
+ goto err_pm_disable;
}
bus_set_iommu(&platform_bus_type, &qcom_iommu_ops);
@@ -852,6 +852,10 @@ static int qcom_iommu_device_probe(struct platform_device *pdev)
}
return 0;
+
+err_pm_disable:
+ pm_runtime_disable(dev);
+ return ret;
}
static int qcom_iommu_device_remove(struct platform_device *pdev)
--
2.17.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] iommu/arm-smmu: Add missing pm_runtime_disable() in qcom_iommu_device_probe
2022-01-05 10:16 [PATCH] iommu/arm-smmu: Add missing pm_runtime_disable() in qcom_iommu_device_probe Miaoqian Lin
@ 2022-02-08 16:21 ` Will Deacon
0 siblings, 0 replies; 2+ messages in thread
From: Will Deacon @ 2022-02-08 16:21 UTC (permalink / raw)
To: Miaoqian Lin
Cc: catalin.marinas, kernel-team, Will Deacon, linux-kernel, iommu,
linux-arm-msm, Rob Clark, linux-arm-kernel, Robin Murphy,
Joerg Roedel
On Wed, 5 Jan 2022 10:16:19 +0000, Miaoqian Lin wrote:
> If the probe fails, we should use pm_runtime_disable() to balance
> pm_runtime_enable().
> Add missing pm_runtime_disable() for error handling.
>
>
Applied to will (for-joerg/arm-smmu/updates), thanks!
[1/1] iommu/arm-smmu: Add missing pm_runtime_disable() in qcom_iommu_device_probe
https://git.kernel.org/will/c/93665e0275a2
Cheers,
--
Will
https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-02-08 16:25 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-05 10:16 [PATCH] iommu/arm-smmu: Add missing pm_runtime_disable() in qcom_iommu_device_probe Miaoqian Lin
2022-02-08 16:21 ` Will Deacon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).