mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] drm/v3d: Add missing unlock
@ 2022-01-22 16:26 Yongzhi Liu
  2022-01-26 20:57 ` Melissa Wen
  0 siblings, 1 reply; 5+ messages in thread
From: Yongzhi Liu @ 2022-01-22 16:26 UTC (permalink / raw)
  To: emma, airlied, daniel; +Cc: dri-devel, linux-kernel, Yongzhi Liu

[why]
Unlock is needed on the error handling path to prevent dead lock.

[how]
Fix this by adding drm_gem_unlock_reservations on the error handling path.

Signed-off-by: Yongzhi Liu <lyz_cs@pku.edu.cn>
---
 drivers/gpu/drm/v3d/v3d_gem.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/v3d/v3d_gem.c b/drivers/gpu/drm/v3d/v3d_gem.c
index c7ed2e1..0c989dc 100644
--- a/drivers/gpu/drm/v3d/v3d_gem.c
+++ b/drivers/gpu/drm/v3d/v3d_gem.c
@@ -798,6 +798,8 @@ v3d_submit_cl_ioctl(struct drm_device *dev, void *data,
 
 		if (!render->base.perfmon) {
 			ret = -ENOENT;
+			drm_gem_unlock_reservations(last_job->bo,
+				    last_job->bo_count, &acquire_ctx);
 			goto fail;
 		}
 	}
@@ -1027,6 +1029,8 @@ v3d_submit_csd_ioctl(struct drm_device *dev, void *data,
 						     args->perfmon_id);
 		if (!job->base.perfmon) {
 			ret = -ENOENT;
+			drm_gem_unlock_reservations(clean_job->bo, clean_job->bo_count,
+						    &acquire_ctx);
 			goto fail;
 		}
 	}
-- 
2.7.4


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

end of thread, other threads:[~2022-01-28 13:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-22 16:26 [PATCH] drm/v3d: Add missing unlock Yongzhi Liu
2022-01-26 20:57 ` Melissa Wen
2022-01-27 10:14   ` [PATCH v2] drm/v3d: fix " Yongzhi Liu
2022-01-28 12:55     ` Melissa Wen
2022-01-28 13:41       ` [PATCH v3] " Yongzhi Liu

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

all inboxes | Powered by JetHome®