|
|
@@ -1,5 +1,34 @@
|
|
|
+From 144ec5e1ce3bd238723a259c09f635b84fda423e Mon Sep 17 00:00:00 2001
|
|
|
+From: =?UTF-8?q?Christian=20K=C3=B6nig?= <christian.koenig@amd.com>
|
|
|
+Date: Fri, 15 Jan 2021 14:32:39 +0100
|
|
|
+Subject: [PATCH] lockdep: add lockdep_assert_none_held_once() macro
|
|
|
+
|
|
|
+[ Upstream commit 7621350c6bb20fb6ab7eb988833ab96eac3dcbef ]
|
|
|
+
|
|
|
+DRM_SYNCOBJ_WAIT_FLAGS_WAIT_FOR_SUBMIT can't be used when we hold locks
|
|
|
+since we are basically waiting for userspace to do something.
|
|
|
+
|
|
|
+Holding a lock while doing so can trivial deadlock with page faults
|
|
|
+etc...
|
|
|
+
|
|
|
+So make lockdep complain when a driver tries to do this.
|
|
|
+
|
|
|
+v2: Add lockdep_assert_none_held() macro.
|
|
|
+v3: Add might_sleep() and also use lockdep_assert_none_held() in the
|
|
|
+ IOCTL path.
|
|
|
+
|
|
|
+Signed-off-by: Christian König <christian.koenig@amd.com>
|
|
|
+Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
|
|
|
+Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
|
|
|
+Link: https://patchwork.freedesktop.org/patch/414944/
|
|
|
+Stable-dep-of: 3c43177ffb54 ("drm/syncobj: call drm_syncobj_fence_add_wait when WAIT_AVAILABLE flag is set")
|
|
|
+Signed-off-by: Sasha Levin <sashal@kernel.org>
|
|
|
+---
|
|
|
+ include/linux/lockdep.h | 5 +++++
|
|
|
+ 1 file changed, 5 insertions(+)
|
|
|
+
|
|
|
diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h
|
|
|
-index 2c25863..3eca9f9 100644
|
|
|
+index 2c2586312b44..3eca9f91b9a5 100644
|
|
|
--- a/include/linux/lockdep.h
|
|
|
+++ b/include/linux/lockdep.h
|
|
|
@@ -321,6 +321,10 @@ extern void lock_unpin_lock(struct lockdep_map *lock, struct pin_cookie);
|
|
|
@@ -21,3 +50,5 @@ index 2c25863..3eca9f9 100644
|
|
|
|
|
|
#define lockdep_recursing(tsk) (0)
|
|
|
|
|
|
+--
|
|
|
+2.55.0
|