mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Adrián Larumbe" <adrian.larumbe@collabora.com>
To: Ruoyu Wang <ruoyuw560@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>,
	 dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drm/panfrost: fix runtime PM leak on remove
Date: Tue, 9 Jun 2026 16:37:28 +0100	[thread overview]
Message-ID: <aigyYE6-GqVfPU1b@sobremesa> (raw)
In-Reply-To: <20260609073407.5-1-ruoyuw560@gmail.com>

Hi Ruoyu, thanks for the patch.

A similar fix is being discussed together with a bunch of other patches at:
https://lore.kernel.org/dri-devel/20260604-claude-fixes-v2-6-57c6bd4c1655@collabora.com/

On 09.06.2026 15:34, Ruoyu Wang wrote:
> pm_runtime_get_sync() increments the runtime PM usage counter even when it
> returns an error. panfrost_remove() uses it to keep the GPU active while
> runtime PM is disabled and the device is finalized, but the usage counter
> is not dropped afterwards.
> 
> Balance the get with pm_runtime_put_noidle() after disabling runtime PM.
> This drops the extra usage count without requesting a runtime suspend,
> preserving the existing teardown sequence that avoids suspending after
> panfrost_device_fini().
> 
> Fixes: 876b15d2c88d ("drm/panfrost: Fix module unload")
> Signed-off-by: Ruoyu Wang <ruoyuw560@gmail.com>
> ---
>  drivers/gpu/drm/panfrost/panfrost_drv.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/gpu/drm/panfrost/panfrost_drv.c b/drivers/gpu/drm/panfrost/panfrost_drv.c
> index 074c0995ddc26..d78ea7d4d099e 100644
> --- a/drivers/gpu/drm/panfrost/panfrost_drv.c
> +++ b/drivers/gpu/drm/panfrost/panfrost_drv.c
> @@ -1027,6 +1027,7 @@ static void panfrost_remove(struct platform_device *pdev)
>  
>  	pm_runtime_get_sync(pfdev->base.dev);
>  	pm_runtime_disable(pfdev->base.dev);
> +	pm_runtime_put_noidle(pfdev->base.dev);
>  	panfrost_device_fini(pfdev);
>  	pm_runtime_set_suspended(pfdev->base.dev);
>  }
> -- 
> 2.51.0


Adrian Larumbe

      reply	other threads:[~2026-06-09 15:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-09  7:34 Ruoyu Wang
2026-06-09 15:37 ` 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=aigyYE6-GqVfPU1b@sobremesa \
    --to=adrian.larumbe@collabora.com \
    --cc=airlied@gmail.com \
    --cc=boris.brezillon@collabora.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=robh@kernel.org \
    --cc=ruoyuw560@gmail.com \
    --cc=simona@ffwll.ch \
    --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®