* [PATCH] remoteproc: rcar: Fix PM imbalance if RPM_ACTIVE
@ 2024-07-08 8:35 Biju Das
2024-07-08 9:12 ` Geert Uytterhoeven
0 siblings, 1 reply; 3+ messages in thread
From: Biju Das @ 2024-07-08 8:35 UTC (permalink / raw)
To: Bjorn Andersson, Mathieu Poirier
Cc: Biju Das, linux-remoteproc, Geert Uytterhoeven,
Prabhakar Mahadev Lad, Biju Das, linux-renesas-soc
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] remoteproc: rcar: Fix PM imbalance if RPM_ACTIVE
2024-07-08 8:35 [PATCH] remoteproc: rcar: Fix PM imbalance if RPM_ACTIVE Biju Das
@ 2024-07-08 9:12 ` Geert Uytterhoeven
2024-07-08 9:17 ` Biju Das
0 siblings, 1 reply; 3+ messages in thread
From: Geert Uytterhoeven @ 2024-07-08 9:12 UTC (permalink / raw)
To: Biju Das
Cc: Bjorn Andersson, Mathieu Poirier, linux-remoteproc,
Prabhakar Mahadev Lad, Biju Das, linux-renesas-soc
Hi Biju,
On Mon, Jul 8, 2024 at 10:36 AM Biju Das <biju.das.jz@bp.renesas.com> wrote:
> 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>
Thanks for your patch, but the code for pm_runtime_resume_and_get()
seems to disagree?
https://elixir.bootlin.com/linux/latest/source/include/linux/pm_runtime.h#L436
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: [PATCH] remoteproc: rcar: Fix PM imbalance if RPM_ACTIVE
2024-07-08 9:12 ` Geert Uytterhoeven
@ 2024-07-08 9:17 ` Biju Das
0 siblings, 0 replies; 3+ messages in thread
From: Biju Das @ 2024-07-08 9:17 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Bjorn Andersson, Mathieu Poirier,
linux-remoteproc@vger.kernel.org, Prabhakar Mahadev Lad,
biju.das.au, linux-renesas-soc@vger.kernel.org
Hi Geert,
> -----Original Message-----
> From: Geert Uytterhoeven <geert@linux-m68k.org>
> Sent: Monday, July 8, 2024 10:12 AM
> Subject: Re: [PATCH] remoteproc: rcar: Fix PM imbalance if RPM_ACTIVE
>
> Hi Biju,
>
> On Mon, Jul 8, 2024 at 10:36 AM Biju Das <biju.das.jz@bp.renesas.com> wrote:
> > 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>
>
> Thanks for your patch, but the code for pm_runtime_resume_and_get() seems to disagree?
> https://elixir.bootlin.com/linux/latest/source/include/linux/pm_runtime.h#L436
Oops. Missed that. Sorry for the noisy patch.
Cheers,
Biju
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-07-08 9:17 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-08 8:35 [PATCH] remoteproc: rcar: Fix PM imbalance if RPM_ACTIVE Biju Das
2024-07-08 9:12 ` Geert Uytterhoeven
2024-07-08 9:17 ` Biju Das
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).