From: Michal Wajdeczko <michal.wajdeczko@intel.com>
To: intel-xe@lists.freedesktop.org
Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>,
Matthew Brost <matthew.brost@intel.com>
Subject: [PATCH 1/2] drm/xe/guc: Use drm_device-managed version of mutex_init()
Date: Sat, 6 Apr 2024 16:39:45 +0200 [thread overview]
Message-ID: <20240406143946.979-1-michal.wajdeczko@intel.com> (raw)
This is safer approach and will help resolve a cleanup ordering
conflict related to the GuC ID manager.
Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Matthew Brost <matthew.brost@intel.com>
---
drivers/gpu/drm/xe/xe_guc_submit.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/xe/xe_guc_submit.c b/drivers/gpu/drm/xe/xe_guc_submit.c
index 9c30bd9ac8c0..4c444fddfba6 100644
--- a/drivers/gpu/drm/xe/xe_guc_submit.c
+++ b/drivers/gpu/drm/xe/xe_guc_submit.c
@@ -238,7 +238,6 @@ static void guc_submit_fini(struct drm_device *drm, void *arg)
xa_destroy(&guc->submission_state.exec_queue_lookup);
free_submit_wq(guc);
- mutex_destroy(&guc->submission_state.lock);
}
static const struct xe_exec_queue_ops guc_exec_queue_ops;
@@ -263,13 +262,16 @@ int xe_guc_submit_init(struct xe_guc *guc)
struct xe_gt *gt = guc_to_gt(guc);
int err;
+ err = drmm_mutex_init(&xe->drm, &guc->submission_state.lock);
+ if (err)
+ return err;
+
err = alloc_submit_wq(guc);
if (err)
return err;
gt->exec_queue_ops = &guc_exec_queue_ops;
- mutex_init(&guc->submission_state.lock);
xa_init(&guc->submission_state.exec_queue_lookup);
spin_lock_init(&guc->submission_state.suspend.lock);
--
2.43.0
next reply other threads:[~2024-04-06 14:40 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-06 14:39 Michal Wajdeczko [this message]
2024-04-06 14:39 ` [PATCH 2/2] drm/xe/guc: Initialize GuC ID manager sooner Michal Wajdeczko
2024-04-06 18:24 ` Matthew Brost
2024-04-06 14:46 ` ✓ CI.Patch_applied: success for series starting with [1/2] drm/xe/guc: Use drm_device-managed version of mutex_init() Patchwork
2024-04-06 14:46 ` ✓ CI.checkpatch: " Patchwork
2024-04-06 14:47 ` ✓ CI.KUnit: " Patchwork
2024-04-06 14:58 ` ✓ CI.Build: " Patchwork
2024-04-06 15:01 ` ✓ CI.Hooks: " Patchwork
2024-04-06 15:02 ` ✓ CI.checksparse: " Patchwork
2024-04-06 15:29 ` ✗ CI.BAT: failure " Patchwork
2024-04-08 9:19 ` Michal Wajdeczko
2024-04-06 18:23 ` [PATCH 1/2] " Matthew Brost
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=20240406143946.979-1-michal.wajdeczko@intel.com \
--to=michal.wajdeczko@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=matthew.brost@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