From: sashiko-bot@kernel.org
To: "Guangshuo Li" <lgs201920130244@gmail.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm/xe: fix autosuspend cleanup during teardown
Date: Sat, 08 Aug 2026 15:02:24 +0000 [thread overview]
Message-ID: <20260808150225.516391F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260808144907.2918746-1-lgs201920130244@gmail.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [Medium] Unbalanced pm_runtime_get_sync() and pm_runtime_forbid() causing a runtime PM usage count leak on driver probe error paths.
--
--- Patch [1]: [PATCH] drm/xe: fix autosuspend cleanup during teardown ---
commit 33bf65f058f06f66ae199db570fd2ab554bf8591
Author: Guangshuo Li <lgs201920130244@gmail.com>
drm/xe: fix autosuspend cleanup during teardown
This patch adds the missing pm_runtime_dont_use_autosuspend() call to the
runtime PM teardown path to prevent a usage count leak.
Cc: stable@vger.kernel.org
> diff --git a/drivers/gpu/drm/xe/xe_pm.c b/drivers/gpu/drm/xe/xe_pm.c
> index a5289a9df8d25..e05290400c650 100644
> --- a/drivers/gpu/drm/xe/xe_pm.c
> +++ b/drivers/gpu/drm/xe/xe_pm.c
> @@ -518,6 +518,7 @@ static void xe_pm_runtime_fini(struct xe_device *xe)
> if (IS_SRIOV_VF(xe))
> return;
>
> + pm_runtime_dont_use_autosuspend(dev);
> pm_runtime_get_sync(dev);
> pm_runtime_forbid(dev);
> }
[Severity: Medium]
This is a pre-existing issue, but does calling pm_runtime_get_sync() and
pm_runtime_forbid() unconditionally here cause a runtime PM usage count leak
on probe error paths?
If xe_pm_init() fails early in xe_pci_probe() (for example, if
xe_pm_set_vram_threshold() returns an error), the error handler calls
xe_pci_remove() which unconditionally executes the teardown functions.
Because xe_pm_init() failed before it could call xe_pm_runtime_init(),
pm_runtime_allow() and pm_runtime_put() were never called to balance the PCI
core's initial reference count.
When xe_pm_runtime_fini() executes pm_runtime_get_sync() and
pm_runtime_forbid() on that error path, it increments the usage count without
checking if initialization actually completed. Will this artificially inflate
the device's usage count and prevent the unbound device from ever being
runtime-suspended after the failed probe?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260808144907.2918746-1-lgs201920130244@gmail.com?part=1
next prev parent reply other threads:[~2026-08-08 15:02 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-08 14:49 [PATCH] drm/xe: fix autosuspend cleanup during teardown Guangshuo Li
2026-08-08 15:02 ` sashiko-bot [this message]
2026-08-08 16:25 ` ✗ LGCI.VerificationFailed: failure for " Patchwork
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=20260808150225.516391F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=lgs201920130244@gmail.com \
--cc=sashiko-reviews@lists.linux.dev \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.