Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Auld <matthew.auld@intel.com>
To: intel-xe@lists.freedesktop.org
Cc: "Karl Mehltretter" <kmehltretter@gmail.com>,
	"Thomas Hellström" <thomas.hellstrom@linux.intel.com>,
	"Matthew Brost" <matthew.brost@intel.com>
Subject: [PATCH 1/3] drm/xe: Fix runtime PM get helpers for CONFIG_PM=n
Date: Mon,  5 Oct 2026 15:41:01 +0100	[thread overview]
Message-ID: <20261005144059.1569162-6-matthew.auld@intel.com> (raw)
In-Reply-To: <20261005144059.1569162-5-matthew.auld@intel.com>

xe_pm_runtime_get_if_active() and xe_pm_runtime_get_if_in_use() rely on
pm_runtime_get_if_active()/pm_runtime_get_if_in_use(), which return
-EINVAL when CONFIG_PM=n. This made both helpers always report the
device as inactive/not in use, even though it is always active
without runtime PM. Treat CONFIG_PM=n as always active/in use.

xe_pm_runtime_get_if_in_use() has behaved this way since it was
introduced; xe_pm_runtime_get_if_active() only started doing so once
it was converted to a bool return using the same '> 0' pattern.

Assisted-by: LLM
Reported-by: Karl Mehltretter <kmehltretter@gmail.com>
Fixes: 3b85b7bcccf4 ("drm/xe: Fix display runtime_pm handling")
Fixes: 46edb0a3eb16 ("drm/xe: Fix xe_pm_runtime_get_if_active return")
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Cc: Matthew Brost <matthew.brost@intel.com>
---
 drivers/gpu/drm/xe/xe_pm.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/gpu/drm/xe/xe_pm.c b/drivers/gpu/drm/xe/xe_pm.c
index daa7ba2df317..385b5984935d 100644
--- a/drivers/gpu/drm/xe/xe_pm.c
+++ b/drivers/gpu/drm/xe/xe_pm.c
@@ -872,6 +872,9 @@ int xe_pm_runtime_get_ioctl(struct xe_device *xe)
  */
 bool xe_pm_runtime_get_if_active(struct xe_device *xe)
 {
+	if (!IS_ENABLED(CONFIG_PM))
+		return true;
+
 	return pm_runtime_get_if_active(xe->drm.dev) > 0;
 }
 
@@ -884,6 +887,9 @@ bool xe_pm_runtime_get_if_active(struct xe_device *xe)
  */
 bool xe_pm_runtime_get_if_in_use(struct xe_device *xe)
 {
+	if (!IS_ENABLED(CONFIG_PM))
+		return true;
+
 	if (xe_pm_read_callback_task(xe) == current) {
 		/* The device is awake, grab the ref and move on */
 		pm_runtime_get_noresume(xe->drm.dev);
-- 
2.55.0


  reply	other threads:[~2026-10-05 14:41 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-05 14:41 [PATCH 0/3] Async RPM with shrinker Matthew Auld
2026-10-05 14:41 ` Matthew Auld [this message]
2026-10-05 14:41 ` [PATCH 2/3] drm/xe/shrinker: use async RPM get Matthew Auld
2026-10-05 14:41 ` [PATCH 3/3] drm/xe/shrinker: hold a stable RPM ref across scan Matthew Auld
2026-10-05 14:51 ` ✗ CI.checkpatch: warning for Async RPM with shrinker Patchwork
2026-10-05 14:54 ` ✓ CI.KUnit: success " Patchwork
2026-10-05 15:36 ` ✓ Xe.CI.BAT: " Patchwork
2026-10-05 22:23 ` ✓ Xe.CI.FULL: " 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=20261005144059.1569162-6-matthew.auld@intel.com \
    --to=matthew.auld@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=kmehltretter@gmail.com \
    --cc=matthew.brost@intel.com \
    --cc=thomas.hellstrom@linux.intel.com \
    /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