Skip to content

Commit

Permalink
irqchip: gic-pm: Use pm_runtime_resume_and_get() in gic_probe()
Browse files Browse the repository at this point in the history
[ Upstream commit f9ee20c ]

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: 9c8eddd ("irqchip/gic: Add platform driver for non-root GICs that require RPM")
Signed-off-by: Shang XiaoJing <shangxiaojing@huawei.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20221124065150.22809-1-shangxiaojing@huawei.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Shang XiaoJing authored and gregkh committed Dec 31, 2022
1 parent 5139cbc commit 77b99b4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/irqchip/irq-gic-pm.c
Expand Up @@ -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;

Expand Down

0 comments on commit 77b99b4

Please sign in to comment.