From: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
To: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Cc: David Carlier <devnexen@gmail.com>,
Daniel Scally <dan.scally@ideasonboard.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Nayden Kanchev <nayden.kanchev@arm.com>,
Hans Verkuil <hverkuil+cisco@kernel.org>,
linux-media@vger.kernel.org
Subject: Re: [PATCH v3 2/3] media: mali-c55: add missing pm_runtime_disable() in remove
Date: Sat, 28 Mar 2026 15:58:18 +0100 [thread overview]
Message-ID: <acfrMuiiRdCTNoMw@zed> (raw)
In-Reply-To: <aca3Y6FHItK1cb9l@zed>
Hi David
since you have to send a v4 anyway, would you care about also
powering off the device duing remove ?
I have a patch, but since you're already looking at this it doesn't
make much sense to pile another one on top.
Could you squash in the below suggestions ?
On Fri, Mar 27, 2026 at 06:01:29PM +0100, Jacopo Mondi wrote:
> Hi David
>
> On Fri, Mar 27, 2026 at 03:07:06PM +0000, David Carlier wrote:
> > pm_runtime_enable() is called during probe but mali_c55_remove() never
> > calls pm_runtime_disable(), leaving the device's runtime PM state
> > enabled after the driver is unbound.
I would use these as the commit message and the commit title:
media: mali-c55: Power-off the peripheral in remove()
The Mali C55 driver doesn't depend on PM. For this reason, if pm_runtime
is not compiled in it is required to manually power-off the peripheral
during the driver's remove() handler.
Also pm_runtime_enable() is called during probe but mali_c55_remove() never
calls pm_runtime_disable(), leaving the device's runtime PM state enabled
after the driver is unbound.
Manually power-off the peripheral in remove() if the peripheral has not
been suspended using runtime_pm and disable runtime pm.
> >
> > Add the missing pm_runtime_disable() call to the remove path.
>
> The driver doesn't depend on PM, so we need to explicitly power-off
> the peripheral in remove() (and set the pm_runtime status to
> suspended)
>
> >
> > Fixes: d5f281f3dd29 ("media: mali-c55: Add Mali-C55 ISP driver")
> > Signed-off-by: David Carlier <devnexen@gmail.com>
>
> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
>
> This patch is however correct, I'll add the power-off on top.
>
> > ---
> > drivers/media/platform/arm/mali-c55/mali-c55-core.c | 1 +
> > 1 file changed, 1 insertion(+)
> >
> > diff --git a/drivers/media/platform/arm/mali-c55/mali-c55-core.c b/drivers/media/platform/arm/mali-c55/mali-c55-core.c
> > index 5cb59c70ffc9..38b11d5ba168 100644
> > --- a/drivers/media/platform/arm/mali-c55/mali-c55-core.c
> > +++ b/drivers/media/platform/arm/mali-c55/mali-c55-core.c
> > @@ -859,6 +859,7 @@ static void mali_c55_remove(struct platform_device *pdev)
> > struct mali_c55 *mali_c55 = platform_get_drvdata(pdev);
> >
> > mali_c55_media_frameworks_deinit(mali_c55);
And this should become:
+ if (!pm_runtime_suspended(&pdev->dev)) {
+ __mali_c55_power_off(mali_c55);
+ pm_runtime_set_suspended(&pdev->dev);
+ }
> > + pm_runtime_disable(&pdev->dev);
Otherwise, if you want to keep your patch simpler, I'll add a patch
for power-off on top.
Thanks
j
> > kfree(mali_c55->context.registers);
> > of_reserved_mem_device_release(&pdev->dev);
> > }
> > --
> > 2.53.0
> >
> >
next prev parent reply other threads:[~2026-03-28 14:58 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-27 15:07 [PATCH v3 1/3] media: mali-c55: add missing of_reserved_mem_device_release() David Carlier
2026-03-27 15:07 ` [PATCH v3 2/3] media: mali-c55: add missing pm_runtime_disable() in remove David Carlier
2026-03-27 17:01 ` Jacopo Mondi
2026-03-28 14:58 ` Jacopo Mondi [this message]
2026-03-28 15:09 ` David CARLIER
2026-03-27 15:07 ` [PATCH v3 3/3] media: mali-c55: fix probe error path skipping pm_runtime_disable() David Carlier
2026-03-27 17:04 ` Jacopo Mondi
2026-03-27 17:10 ` David CARLIER
2026-03-27 16:58 ` [PATCH v3 1/3] media: mali-c55: add missing of_reserved_mem_device_release() Jacopo Mondi
2026-03-27 17:05 ` David CARLIER
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=acfrMuiiRdCTNoMw@zed \
--to=jacopo.mondi@ideasonboard.com \
--cc=dan.scally@ideasonboard.com \
--cc=devnexen@gmail.com \
--cc=hverkuil+cisco@kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=nayden.kanchev@arm.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