Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Wajdeczko <michal.wajdeczko@intel.com>
To: intel-xe@lists.freedesktop.org
Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
Subject: [RFC 2/3] drm/xe: Use new FW guard in xe_mocs.c
Date: Mon, 17 Jun 2024 16:34:29 +0200	[thread overview]
Message-ID: <20240617143430.641-3-michal.wajdeczko@intel.com> (raw)
In-Reply-To: <20240617143430.641-1-michal.wajdeczko@intel.com>

Start using new FW guard to minimize risk of leaking force-wake
references.

Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
---
 drivers/gpu/drm/xe/xe_mocs.c | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_mocs.c b/drivers/gpu/drm/xe/xe_mocs.c
index de3f2d3f1b04..f863e149d61d 100644
--- a/drivers/gpu/drm/xe/xe_mocs.c
+++ b/drivers/gpu/drm/xe/xe_mocs.c
@@ -774,7 +774,6 @@ void xe_mocs_dump(struct xe_gt *gt, struct drm_printer *p)
 {
 	struct xe_mocs_info table;
 	unsigned int flags;
-	u32 ret;
 	struct xe_device *xe = gt_to_xe(gt);
 
 	flags = get_mocs_settings(xe, &table);
@@ -783,17 +782,10 @@ void xe_mocs_dump(struct xe_gt *gt, struct drm_printer *p)
 		return;
 
 	xe_pm_runtime_get_noresume(xe);
-	ret = xe_force_wake_get(gt_to_fw(gt), XE_FW_GT);
 
-	if (ret)
-		goto err_fw;
+	scoped_guard(xe_fw, gt_to_fw(gt), XE_FW_GT)
+		table.ops->dump(&table, flags, gt, p);
 
-	table.ops->dump(&table, flags, gt, p);
-
-	xe_force_wake_put(gt_to_fw(gt), XE_FW_GT);
-
-err_fw:
-	xe_assert(xe, !ret);
 	xe_pm_runtime_put(xe);
 }
 
-- 
2.43.0


  parent reply	other threads:[~2024-06-17 14:34 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-17 14:34 [RFC 0/3] FW guard class Michal Wajdeczko
2024-06-17 14:34 ` [RFC 1/3] drm/xe: Introduce force-wake " Michal Wajdeczko
2024-06-17 14:34 ` Michal Wajdeczko [this message]
2024-06-17 14:34 ` [RFC 3/3] drm/xe: Use new FW guard in xe_pat.c Michal Wajdeczko
2024-06-17 14:59 ` ✓ CI.Patch_applied: success for FW guard class Patchwork
2024-06-17 15:00 ` ✗ CI.checkpatch: warning " Patchwork
2024-06-17 15:01 ` ✓ CI.KUnit: success " Patchwork
2024-06-17 15:13 ` ✓ CI.Build: " Patchwork
2024-06-17 15:15 ` ✗ CI.Hooks: failure " Patchwork
2024-06-17 15:16 ` ✓ CI.checksparse: success " Patchwork
2024-06-17 15:38 ` ✓ CI.BAT: " Patchwork
2024-06-17 17:24 ` [RFC 0/3] " Matthew Brost
2024-06-17 18:00   ` Rodrigo Vivi
2024-06-17 18:06     ` Matthew Brost
2024-06-17 19:24     ` Michal Wajdeczko
2024-06-17 23:30       ` Matthew Brost
2024-06-18  0:54         ` Lucas De Marchi
2024-06-18  1:16           ` Matthew Brost
2024-06-18 18:08             ` Michal Wajdeczko
2024-06-18 18:44               ` Matthew Brost
2024-06-18 20:26           ` Rodrigo Vivi
2024-06-19  6:40             ` Thomas Hellström
2024-06-19 18:46               ` Rodrigo Vivi
2024-06-24 16:32             ` Nirmoy Das
2024-06-18  6:39 ` ✗ CI.FULL: 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=20240617143430.641-3-michal.wajdeczko@intel.com \
    --to=michal.wajdeczko@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    /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