Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/xe: validate client of BO inside lock
@ 2024-06-03 14:28 Tejas Upadhyay
  2024-06-04 17:32 ` ✓ CI.Patch_applied: success for " Patchwork
                   ` (8 more replies)
  0 siblings, 9 replies; 11+ messages in thread
From: Tejas Upadhyay @ 2024-06-03 14:28 UTC (permalink / raw)
  To: intel-xe; +Cc: Tejas Upadhyay

As client of BO getting referenced inside lock of BOs
list, its good practice to move these WARN_ONs also
under same lock to validate existance of bo->client.

Signed-off-by: Tejas Upadhyay <tejas.upadhyay@intel.com>
---
 drivers/gpu/drm/xe/xe_drm_client.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_drm_client.c b/drivers/gpu/drm/xe/xe_drm_client.c
index 4a19b771e3a0..7881b02fa117 100644
--- a/drivers/gpu/drm/xe/xe_drm_client.c
+++ b/drivers/gpu/drm/xe/xe_drm_client.c
@@ -131,10 +131,9 @@ void __xe_drm_client_free(struct kref *kref)
 void xe_drm_client_add_bo(struct xe_drm_client *client,
 			  struct xe_bo *bo)
 {
+	spin_lock(&client->bos_lock);
 	XE_WARN_ON(bo->client);
 	XE_WARN_ON(!list_empty(&bo->client_link));
-
-	spin_lock(&client->bos_lock);
 	bo->client = xe_drm_client_get(client);
 	list_add_tail(&bo->client_link, &client->bos_list);
 	spin_unlock(&client->bos_lock);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2024-06-05  7:30 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-03 14:28 [PATCH] drm/xe: validate client of BO inside lock Tejas Upadhyay
2024-06-04 17:32 ` ✓ CI.Patch_applied: success for " Patchwork
2024-06-04 17:33 ` ✗ CI.checkpatch: warning " Patchwork
2024-06-04 17:35 ` ✓ CI.KUnit: success " Patchwork
2024-06-04 17:49 ` ✓ CI.Build: " Patchwork
2024-06-04 17:49 ` ✗ CI.Hooks: failure " Patchwork
2024-06-04 17:50 ` ✓ CI.checksparse: success " Patchwork
2024-06-04 18:30 ` ✓ CI.BAT: " Patchwork
2024-06-04 22:58 ` ✗ CI.FULL: failure " Patchwork
2024-06-05  6:41 ` [PATCH] " Ghimiray, Himal Prasad
2024-06-05  7:29   ` Ghimiray, Himal Prasad

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox