mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Adrián Larumbe" <adrian.larumbe@collabora.com>
To: Guangshuo Li <lgs201920130244@gmail.com>
Cc: Boris Brezillon <boris.brezillon@collabora.com>,
	 Rob Herring <robh@kernel.org>,
	Steven Price <steven.price@arm.com>,
	 Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	 Thomas Zimmermann <tzimmermann@suse.de>,
	David Airlie <airlied@gmail.com>,
	 Simona Vetter <simona@ffwll.ch>,
	Tomeu Vizoso <tomeu@tomeuvizoso.net>,
	 Eric Anholt <eric@anholt.net>,
	"Marty E. Plummer" <hanetzer@startmail.com>,
	 dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	stable@vger.kernel.org
Subject: Re: [PATCH] drm/panfrost: fix autosuspend cleanup during teardown
Date: Sat, 12 Sep 2026 00:33:23 +0100	[thread overview]
Message-ID: <aqSOyUCZ7rT-u1hF@sobremesa> (raw)
In-Reply-To: <CANUHTR9Xneqaa7FvdKmwuBfKiBuj2nE+nOXOxuR_cJYjExiemQ@mail.gmail.com>

Hi Guangshou,

I'm afraid in the end I can't apply this patch because the series I wrote, besides including this
fix, has quite a few others to deal with existing issues with power management in the driver.
It felt awkard to apply this one in isolation without addresing the other bugs at the same time.

Check https://lore.kernel.org/r/20260912-claude-fixes-v9-0-e588feaa61ef@collabora.com for further
context, patch 6/16 to be more precise.

However, like I said in a previous message, I'll soon be compiling a list of existing issues
and post them on a Freedesktop Gitlab issue for anyone curious to have a go at.

Cheers,
Adrian

On 13.08.2026 10:10, Guangshuo Li wrote:
> Hi Adrian,
> 
> On Wed, 12 Aug 2026 at 22:35, Adrián Larumbe
> <adrian.larumbe@collabora.com> wrote:
> >
> > Hi Guangshuo,
> >
> > Recently I've been working on a patch series that addresses PM refcnt imbalances in Panfrost.
> > One of the fixes introduces devm_pm_runtime_enable(), so manually calling pm_runtime_dont_use_autosuspend()
> > is no longer necessary like you mentioned in the commit message.
> >
> > However, there might be a point in using it during device teardown and probe error just like Panthor does,
> > becasue it doesn't make sense to postpone suspension when the device is going away.
> >
> > Anyway, you can have a look at it here:
> > https://lore.kernel.org/r/20260811-claude-fixes-v5-0-3d692c9e98c2@collabora.com
> >
> > I was thinking, I'll let you know when I've v6 ready and then you could rebase this patch onto it
> > before I submit the series to the ML so that I can send them all together?
> >
> > Kind Regards,
> > Adrian
> >
> > On 08.08.2026 21:50, Guangshuo Li wrote:
> > > panfrost_probe() calls pm_runtime_use_autosuspend(), but neither the
> > > probe error path nor panfrost_remove() calls the matching
> > > pm_runtime_dont_use_autosuspend() during teardown.
> > >
> > > If the autosuspend delay is set to a negative value while autosuspend
> > > is enabled, the runtime PM core increments usage_count to prevent
> > > runtime suspend. Without calling pm_runtime_dont_use_autosuspend()
> > > during teardown, this reference is not dropped.
> > >
> > > The documentation for pm_runtime_use_autosuspend() also notes that it
> > > is important to undo it with pm_runtime_dont_use_autosuspend() at
> > > driver exit time, unless runtime PM was initially enabled with
> > > devm_pm_runtime_enable().
> > >
> > > Add the missing pm_runtime_dont_use_autosuspend() calls to both the
> > > probe failure and device removal paths.
> > >
> > > This issue was found by manual code inspection.
> > >
> > > Fixes: f3ba91228e8e ("drm/panfrost: Add initial panfrost driver")
> > > Cc: stable@vger.kernel.org
> > > Signed-off-by: Guangshuo Li <lgs201920130244@gmail.com>
> > > ---
> > >  drivers/gpu/drm/panfrost/panfrost_drv.c | 2 ++
> > >  1 file changed, 2 insertions(+)
> > >
> > > diff --git a/drivers/gpu/drm/panfrost/panfrost_drv.c b/drivers/gpu/drm/panfrost/panfrost_drv.c
> > > index 784e36d72c2b..007dcba62e62 100644
> > > --- a/drivers/gpu/drm/panfrost/panfrost_drv.c
> > > +++ b/drivers/gpu/drm/panfrost/panfrost_drv.c
> > > @@ -1011,6 +1011,7 @@ static int panfrost_probe(struct platform_device *pdev)
> > >  err_out2:
> > >       drm_dev_unregister(&pfdev->base);
> > >  err_out1:
> > > +     pm_runtime_dont_use_autosuspend(pfdev->base.dev);
> > >       pm_runtime_disable(pfdev->base.dev);
> > >       panfrost_device_fini(pfdev);
> > >       pm_runtime_set_suspended(pfdev->base.dev);
> > > @@ -1025,6 +1026,7 @@ static void panfrost_remove(struct platform_device *pdev)
> > >       drm_dev_unregister(&pfdev->base);
> > >       panfrost_gem_shrinker_cleanup(&pfdev->base);
> > >
> > > +     pm_runtime_dont_use_autosuspend(pfdev->base.dev);
> > >       pm_runtime_get_sync(pfdev->base.dev);
> > >       pm_runtime_disable(pfdev->base.dev);
> > >       panfrost_device_fini(pfdev);
> > > --
> > > 2.43.0
> >
> > Adrian Larumbe
> 
> Sure, I’d be glad to do that. Please let me know when v6 is ready, and
> I’ll rebase my patch on top of it.
> 
> Best regards,
> Guangshuo

Adrian Larumbe

      reply	other threads:[~2026-09-11 23:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-08 13:50 Guangshuo Li
2026-08-12 14:34 ` Adrián Larumbe
2026-08-13  2:10   ` Guangshuo Li
2026-09-11 23:33     ` Adrián Larumbe [this message]

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=aqSOyUCZ7rT-u1hF@sobremesa \
    --to=adrian.larumbe@collabora.com \
    --cc=airlied@gmail.com \
    --cc=boris.brezillon@collabora.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=eric@anholt.net \
    --cc=hanetzer@startmail.com \
    --cc=lgs201920130244@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=robh@kernel.org \
    --cc=simona@ffwll.ch \
    --cc=stable@vger.kernel.org \
    --cc=steven.price@arm.com \
    --cc=tomeu@tomeuvizoso.net \
    --cc=tzimmermann@suse.de \
    /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

all inboxes | Powered by JetHome®