From: Mikko Perttunen <mperttunen@nvidia.com>
To: Thierry Reding <thierry.reding@kernel.org>,
David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
Dmitry Osipenko <digetx@gmail.com>, Ulf Hansson <ulfh@kernel.org>,
dri-devel@lists.freedesktop.org, linux-tegra@vger.kernel.org,
linux-kernel@vger.kernel.org,
Guangshuo Li <lgs201920130244@gmail.com>
Cc: Guangshuo Li <lgs201920130244@gmail.com>, stable@vger.kernel.org
Subject: Re: [PATCH] gpu: host1x: fix runtime PM reference leak on remove
Date: Mon, 14 Sep 2026 14:39:16 +0900 [thread overview]
Message-ID: <UqvaHP03S_-FFGTtKijH0w@nvidia.com> (raw)
In-Reply-To: <20260913120227.1559129-1-lgs201920130244@gmail.com>
On Sunday, September 13, 2026 9:02 PM Guangshuo Li wrote:
> host1x_probe() calls pm_runtime_resume_and_get() and intentionally keeps
> the runtime PM usage reference for the lifetime of the driver because
> host1x is not yet ready for dynamic runtime PM.
>
> The probe error path drops this reference with
> pm_runtime_put_sync_suspend(), but the remove path only calls
> pm_runtime_force_suspend().
>
> pm_runtime_force_suspend() disables runtime PM and invokes the runtime
> suspend callback when necessary, but it does not decrement the runtime
> PM usage counter. As a result, the reference acquired by
> pm_runtime_resume_and_get() remains held after the driver is unbound.
> Repeated bind and unbind cycles can therefore leave the runtime PM
> usage counter increasingly unbalanced.
>
> Drop the usage reference with pm_runtime_put_sync_suspend() before
> forcing the device into suspend during removal.
>
> This issue was found by manual code inspection.
>
> Fixes: 6b6776e2ab8a ("gpu: host1x: Add initial runtime PM and OPP support")
> Cc: stable@vger.kernel.org
> Signed-off-by: Guangshuo Li <lgs201920130244@gmail.com>
> ---
> drivers/gpu/host1x/dev.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/host1x/dev.c b/drivers/gpu/host1x/dev.c
> index d2c64728f804..bb6a1647e4db 100644
> --- a/drivers/gpu/host1x/dev.c
> +++ b/drivers/gpu/host1x/dev.c
> @@ -729,6 +729,7 @@ static void host1x_remove(struct platform_device *pdev)
> host1x_unregister(host);
> host1x_debug_deinit(host);
>
> + pm_runtime_put_sync_suspend(&pdev->dev);
> pm_runtime_force_suspend(&pdev->dev);
After the pm_runtime_put_sync_suspend, the device should always be
suspended, so I think we should also replace the call to
pm_runtime_force_suspend with a pm_runtime_disable.
Thank you!
Mikko
>
> host1x_intr_deinit(host);
> --
> 2.43.0
>
>
prev parent reply other threads:[~2026-09-14 5:39 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-13 12:02 Guangshuo Li
2026-09-14 5:39 ` Mikko Perttunen [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=UqvaHP03S_-FFGTtKijH0w@nvidia.com \
--to=mperttunen@nvidia.com \
--cc=airlied@gmail.com \
--cc=digetx@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=lgs201920130244@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=simona@ffwll.ch \
--cc=stable@vger.kernel.org \
--cc=thierry.reding@kernel.org \
--cc=ulfh@kernel.org \
/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®