Skip to contentSkip to conversation

irqchip: gic-pm: Use pm_runtime_resume_and_get() in gic_probe()

PATCH Applied Shang XiaoJing 2 participants 2 messages Nov 24, 2022 – Nov 26, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 irqchip: gic-pm: Use pm_runtime_resume_and_get() in gic_probe()

gic_probe() calls pm_runtime_get_sync() and added fail path as rpm_put to put usage_counter. However, pm_runtime_get_sync() will increment usage_counter even it failed. Fix it by replacing it with pm_runtime_resume_and_get() to keep usage counter balanced.

Fixes 9c8edddfc992 ("irqchip/gic: Add platform driver for non-root GICs that require RPM")
---
 drivers/irqchip/irq-gic-pm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/irqchip/irq-gic-pm.c +1 -1
index b60e1853593f..3989d16f997b 100644
@@ -102,7 +102,7 @@ static int gic_probe(struct platform_device *pdev)
 
 	pm_runtime_enable(dev);
 
-	ret = pm_runtime_get_sync(dev);
+	ret = pm_runtime_resume_and_get(dev);
 	if (ret < 0)
 		goto rpm_disable;
 
Signature · 1 line
2.17.1
#1 lore raw
The following commit has been merged into the irq/irqchip-next branch of irqchip:

The following commit has been merged into the irq/irqchip-next branch of irqchip:

Commit-ID:     f9ee20c85b3a3ba0afd3672630ec4f93d339f015
Gitweb:        https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms/f9ee20c85b3a3ba0afd3672630ec4f93d339f015
Author:        Shang XiaoJing <[email protected]>
AuthorDate:    Thu, 24 Nov 2022 14:51:50 +08:00
Committer:     Marc Zyngier <[email protected]>
CommitterDate: Sat, 26 Nov 2022 13:29:42 

irqchip: gic-pm: Use pm_runtime_resume_and_get() in gic_probe()

gic_probe() calls pm_runtime_get_sync() and added fail path as rpm_put to put usage_counter. However, pm_runtime_get_sync() will increment usage_counter even it failed. Fix it by replacing it with pm_runtime_resume_and_get() to keep usage counter balanced.

Fixes 9c8edddfc992 ("irqchip/gic: Add platform driver for non-root GICs that require RPM")
---
 drivers/irqchip/irq-gic-pm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/irqchip/irq-gic-pm.c +1 -1
index b60e185..3989d16 100644
@@ -102,7 +102,7 @@ static int gic_probe(struct platform_device *pdev)
 
 	pm_runtime_enable(dev);
 
-	ret = pm_runtime_get_sync(dev);
+	ret = pm_runtime_resume_and_get(dev);
 	if (ret < 0)
 		goto rpm_disable;