Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Brost <matthew.brost@intel.com>
To: intel-xe@lists.freedesktop.org
Subject: [PATCH 2/2] drm/xe: Drop VM dma-resv lock on xe_sync_in_fence_get failure in exec IOCTL
Date: Mon,  4 Nov 2024 16:38:31 -0800	[thread overview]
Message-ID: <20241105003832.4021758-3-matthew.brost@intel.com> (raw)
In-Reply-To: <20241105003832.4021758-1-matthew.brost@intel.com>

Upon failure all locks need to be dropped before returning to the user.

Fixes: 58480c1c912f ("drm/xe: Skip VMAs pin when requesting signal to the last XE_EXEC")
Cc: stable <stable@kernel.org>
Signed-off-by: Matthew Brost <matthew.brost@intel.com>
---
 drivers/gpu/drm/xe/xe_exec.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/xe/xe_exec.c b/drivers/gpu/drm/xe/xe_exec.c
index 6de12f91b865..756b492f13b0 100644
--- a/drivers/gpu/drm/xe/xe_exec.c
+++ b/drivers/gpu/drm/xe/xe_exec.c
@@ -224,6 +224,7 @@ int xe_exec_ioctl(struct drm_device *dev, void *data, struct drm_file *file)
 			fence = xe_sync_in_fence_get(syncs, num_syncs, q, vm);
 			if (IS_ERR(fence)) {
 				err = PTR_ERR(fence);
+				xe_vm_unlock(vm);
 				goto err_unlock_list;
 			}
 			for (i = 0; i < num_syncs; i++)
-- 
2.34.1


  parent reply	other threads:[~2024-11-05  0:38 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-05  0:38 [PATCH 0/2] A couple exec IOCTL fixes Matthew Brost
2024-11-05  0:38 ` [PATCH 1/2] drm/xe: Fix possible exec queue leak in exec IOCTL Matthew Brost
2024-11-05  2:44   ` Rodrigo Vivi
2024-11-05  4:45     ` Matthew Brost
2024-11-05  0:38 ` Matthew Brost [this message]
2024-11-05  2:46   ` [PATCH 2/2] drm/xe: Drop VM dma-resv lock on xe_sync_in_fence_get failure " Rodrigo Vivi
2024-11-05  0:38 ` [PATCH v2] drm/xe: Restore system memory GGTT mappings Matthew Brost
  -- strict thread matches above, loose matches on Subject: below --
2024-11-05  4:35 [PATCH 0/2] A couple exec IOCTL fixes Matthew Brost
2024-11-05  4:35 ` [PATCH 2/2] drm/xe: Drop VM dma-resv lock on xe_sync_in_fence_get failure in exec IOCTL Matthew Brost
2024-11-05  6:47   ` Upadhyay, Tejas
2024-11-05 20:55   ` Lucas De Marchi

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=20241105003832.4021758-3-matthew.brost@intel.com \
    --to=matthew.brost@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