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: Matthew Brost <matthew.brost@intel.com>,
	Nirmoy Das <nirmoy.das@intel.com>
Subject: [PATCH v2 2/2] drm/xe: fix unbalanced rpm put() with declare_wedged()
Date: Wed,  9 Oct 2024 09:48:10 +0100	[thread overview]
Message-ID: <20241009084808.204432-4-matthew.auld@intel.com> (raw)
In-Reply-To: <20241009084808.204432-3-matthew.auld@intel.com>

Technically the or_reset() means we call the action on failure, however
that would lead to unbalanced rpm put(). Move the get() earlier to fix
this. It should be extremely unlikely to ever trigger this in practice.

Fixes: 452bca0edbd0 ("drm/xe: Don't suspend device upon wedge")
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Matthew Brost <matthew.brost@intel.com>
Cc: Nirmoy Das <nirmoy.das@intel.com>
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
---
 drivers/gpu/drm/xe/xe_device.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_device.c b/drivers/gpu/drm/xe/xe_device.c
index cd241a8e1838..962751c966d1 100644
--- a/drivers/gpu/drm/xe/xe_device.c
+++ b/drivers/gpu/drm/xe/xe_device.c
@@ -1016,13 +1016,13 @@ void xe_device_declare_wedged(struct xe_device *xe)
 		return;
 	}
 
+	xe_pm_runtime_get_noresume(xe);
+
 	if (drmm_add_action_or_reset(&xe->drm, xe_device_wedged_fini, xe)) {
 		drm_err(&xe->drm, "Failed to register xe_device_wedged_fini clean-up. Although device is wedged.\n");
 		return;
 	}
 
-	xe_pm_runtime_get_noresume(xe);
-
 	if (!atomic_xchg(&xe->wedged.flag, 1)) {
 		xe->needs_flr_on_fini = true;
 		drm_err(&xe->drm,
-- 
2.46.2


  reply	other threads:[~2024-10-09  8:48 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-09  8:48 [PATCH v2 1/2] drm/xe: fix unbalanced rpm put() with fence_fini() Matthew Auld
2024-10-09  8:48 ` Matthew Auld [this message]
2024-10-09  8:57   ` [PATCH v2 2/2] drm/xe: fix unbalanced rpm put() with declare_wedged() Nirmoy Das
2024-10-09  8:50 ` [PATCH v2 1/2] drm/xe: fix unbalanced rpm put() with fence_fini() Nirmoy Das
2024-10-09 10:45 ` ✓ CI.Patch_applied: success for series starting with [v2,1/2] " Patchwork
2024-10-09 10:45 ` ✓ CI.checkpatch: " Patchwork
2024-10-09 10:46 ` ✓ CI.KUnit: " Patchwork
2024-10-09 10:58 ` ✓ CI.Build: " Patchwork
2024-10-09 11:00 ` ✓ CI.Hooks: " Patchwork
2024-10-09 11:02 ` ✓ CI.checksparse: " Patchwork
2024-10-09 11:28 ` ✓ CI.BAT: " Patchwork
2024-10-09 17:22 ` ✗ CI.FULL: failure " 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=20241009084808.204432-4-matthew.auld@intel.com \
    --to=matthew.auld@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=matthew.brost@intel.com \
    --cc=nirmoy.das@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