From: Biju Das <biju.das.jz@bp.renesas.com>
To: Bjorn Andersson <andersson@kernel.org>,
Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: Biju Das <biju.das.jz@bp.renesas.com>,
linux-remoteproc@vger.kernel.org,
Geert Uytterhoeven <geert+renesas@glider.be>,
Prabhakar Mahadev Lad <prabhakar.mahadev-lad.rj@bp.renesas.com>,
Biju Das <biju.das.au@gmail.com>,
linux-renesas-soc@vger.kernel.org
Subject: [PATCH] remoteproc: rcar: Fix PM imbalance if RPM_ACTIVE
Date: Mon, 8 Jul 2024 09:35:51 +0100 [thread overview]
Message-ID: <20240708083553.30799-1-biju.das.jz@bp.renesas.com> (raw)
The pm_runtime_resume_and_get() returns 1 if RPM is active, in this
case it won't call a put. This will result in PM imbalance as it
treat this as an error and propagate this to caller and the caller
never calls corresponding put(). Fix this issue by checking error
condition only.
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
drivers/remoteproc/rcar_rproc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/remoteproc/rcar_rproc.c b/drivers/remoteproc/rcar_rproc.c
index cc17e8421f65..3373a74d8b3a 100644
--- a/drivers/remoteproc/rcar_rproc.c
+++ b/drivers/remoteproc/rcar_rproc.c
@@ -174,7 +174,7 @@ static int rcar_rproc_probe(struct platform_device *pdev)
pm_runtime_enable(dev);
ret = pm_runtime_resume_and_get(dev);
- if (ret) {
+ if (ret < 0) {
dev_err(dev, "failed to power up\n");
return ret;
}
--
2.43.0
next reply other threads:[~2024-07-08 8:35 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-08 8:35 Biju Das [this message]
2024-07-08 9:12 ` [PATCH] remoteproc: rcar: Fix PM imbalance if RPM_ACTIVE Geert Uytterhoeven
2024-07-08 9:17 ` Biju Das
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=20240708083553.30799-1-biju.das.jz@bp.renesas.com \
--to=biju.das.jz@bp.renesas.com \
--cc=andersson@kernel.org \
--cc=biju.das.au@gmail.com \
--cc=geert+renesas@glider.be \
--cc=linux-remoteproc@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=mathieu.poirier@linaro.org \
--cc=prabhakar.mahadev-lad.rj@bp.renesas.com \
/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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).