xe_pm_runtime_get_ioctl() uses pm_runtime_get_sync(), which increments
the usage counter even when resuming the device fails. Its conditional
runtime PM guard only runs xe_pm_runtime_put() after a successful get,
so failed resumes leave an extra reference behind.

Use pm_runtime_resume_and_get() so a failed resume releases the usage
counter increment before returning the error.

Fixes: 23cf006beac3 ("drm/xe: Runtime PM wake on every IOCTL")
Cc: [email protected]
Assisted-by: DeepSeek-V4.1-Flash and OpenAI Codex
Signed-off-by: Wentao Liang <[email protected]>
---
 drivers/gpu/drm/xe/xe_pm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/xe/xe_pm.c b/drivers/gpu/drm/xe/xe_pm.c
index 4f1035ab1eb2..52c2a15e642f 100644
--- a/drivers/gpu/drm/xe/xe_pm.c
+++ b/drivers/gpu/drm/xe/xe_pm.c
@@ -860,7 +860,7 @@ int xe_pm_runtime_get_ioctl(struct xe_device *xe)
                return -ELOOP;
 
        xe_rpm_might_enter_cb(xe);
-       return pm_runtime_get_sync(xe->drm.dev);
+       return pm_runtime_resume_and_get(xe->drm.dev);
 }
 
 /**
-- 
2.34.1

Reply via email to