From: Yuho Choi <dbgh9129@gmail.com>
To: Russell King <linux@armlinux.org.uk>
Cc: Ulf Hansson <ulfh@kernel.org>,
Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>,
Mathieu Poirier <mathieu.poirier@linaro.org>,
Danilo Krummrich <dakr@kernel.org>, Kees Cook <kees@kernel.org>,
linux-kernel@vger.kernel.org, Yuho Choi <dbgh9129@gmail.com>
Subject: [PATCH v1] amba: Fix pclk leak on runtime resume failure
Date: Tue, 7 Jul 2026 14:22:44 -0400 [thread overview]
Message-ID: <20260707182245.420594-1-dbgh9129@gmail.com> (raw)
amba_pm_runtime_resume() enables the AMBA pclk before calling the
driver runtime resume callback. If that callback fails, the function
returns with pclk still enabled.
Disable pclk on pm_generic_runtime_resume() failure, matching the clock
state rollback expected by the runtime suspend/resume path.
Fixes: 92b97f0aaccb ("PM: add runtime PM support to core Primecell driver")
Signed-off-by: Yuho Choi <dbgh9129@gmail.com>
---
drivers/amba/bus.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c
index d721d64a9858..5a36463f1438 100644
--- a/drivers/amba/bus.c
+++ b/drivers/amba/bus.c
@@ -389,7 +389,15 @@ static int amba_pm_runtime_resume(struct device *dev)
return ret;
}
- return pm_generic_runtime_resume(dev);
+ ret = pm_generic_runtime_resume(dev);
+ if (ret && dev->driver) {
+ if (pm_runtime_is_irq_safe(dev))
+ clk_disable(pcdev->pclk);
+ else
+ clk_disable_unprepare(pcdev->pclk);
+ }
+
+ return ret;
}
#endif /* CONFIG_PM */
--
2.43.0
reply other threads:[~2026-07-07 18:22 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260707182245.420594-1-dbgh9129@gmail.com \
--to=dbgh9129@gmail.com \
--cc=claudiu.beznea.uj@bp.renesas.com \
--cc=dakr@kernel.org \
--cc=kees@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=mathieu.poirier@linaro.org \
--cc=ulfh@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox