* [PATCH] drm/xe: fix autosuspend cleanup during teardown
@ 2026-08-08 14:49 Guangshuo Li
2026-08-08 15:02 ` sashiko-bot
2026-08-08 16:25 ` ✗ LGCI.VerificationFailed: failure for " Patchwork
0 siblings, 2 replies; 3+ messages in thread
From: Guangshuo Li @ 2026-08-08 14:49 UTC (permalink / raw)
To: Matthew Brost, Thomas Hellström, Rodrigo Vivi, David Airlie,
Simona Vetter, intel-xe, dri-devel, linux-kernel
Cc: Guangshuo Li, stable
xe_pm_runtime_init() calls pm_runtime_use_autosuspend(), but
xe_pm_runtime_fini() does not call 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() call to the runtime
PM teardown path.
This issue was found by manual code inspection.
Fixes: dd08ebf6c352 ("drm/xe: Introduce a new DRM driver for Intel GPUs")
Cc: stable@vger.kernel.org
Signed-off-by: Guangshuo Li <lgs201920130244@gmail.com>
---
drivers/gpu/drm/xe/xe_pm.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/gpu/drm/xe/xe_pm.c b/drivers/gpu/drm/xe/xe_pm.c
index 99562f691080..301789adaa21 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);
}
--
2.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] drm/xe: fix autosuspend cleanup during teardown
2026-08-08 14:49 [PATCH] drm/xe: fix autosuspend cleanup during teardown Guangshuo Li
@ 2026-08-08 15:02 ` sashiko-bot
2026-08-08 16:25 ` ✗ LGCI.VerificationFailed: failure for " Patchwork
1 sibling, 0 replies; 3+ messages in thread
From: sashiko-bot @ 2026-08-08 15:02 UTC (permalink / raw)
To: Guangshuo Li; +Cc: dri-devel
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* ✗ LGCI.VerificationFailed: failure for drm/xe: fix autosuspend cleanup during teardown
2026-08-08 14:49 [PATCH] drm/xe: fix autosuspend cleanup during teardown Guangshuo Li
2026-08-08 15:02 ` sashiko-bot
@ 2026-08-08 16:25 ` Patchwork
1 sibling, 0 replies; 3+ messages in thread
From: Patchwork @ 2026-08-08 16:25 UTC (permalink / raw)
To: Guangshuo Li; +Cc: intel-xe
== Series Details ==
Series: drm/xe: fix autosuspend cleanup during teardown
URL : https://patchwork.freedesktop.org/series/171838/
State : failure
== Summary ==
Series author address 'lgs201920130244@gmail.com' is not on the allowlist, which prevents CI from being automatically triggered.
If you want CI to run for this series, ask Patchwork project owners to click 'retest' on the series in Patchwork.
Exception occurred during validation, bailing out!
Build URL: http://intel-gfx-ci-public.igk.intel.com:8080/job/xe_pw_trigger/1241151/ (on master)
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-08-08 16:25 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-08 14:49 [PATCH] drm/xe: fix autosuspend cleanup during teardown Guangshuo Li
2026-08-08 15:02 ` sashiko-bot
2026-08-08 16:25 ` ✗ LGCI.VerificationFailed: failure for " Patchwork
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.