summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2019-11-04 18:37:19 +0100
committerMaarten Lankhorst <maarten.lankhorst@linux.intel.com>2019-11-07 09:58:32 +0100
commite692b4021a2e48745d4bdac2b2775bdc8f03b433 (patch)
treea72e213cc594f2149d51ec025835e7468aa24b85 /include
parentf86dbacb30029f4e0396e8b18b0ca60fabaec6c4 (diff)
downloadlinux-e692b4021a2e48745d4bdac2b2775bdc8f03b433.tar.gz
linux-e692b4021a2e48745d4bdac2b2775bdc8f03b433.tar.bz2
linux-e692b4021a2e48745d4bdac2b2775bdc8f03b433.zip
lockdep: add might_lock_nested()
Necessary to annotate functions where we might acquire a mutex_lock_nested() or similar. Needed by i915. Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Ingo Molnar <mingo@redhat.com> Cc: Will Deacon <will@kernel.org> Cc: linux-kernel@vger.kernel.org Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20191104173720.2696-2-daniel.vetter@ffwll.ch
Diffstat (limited to 'include')
-rw-r--r--include/linux/lockdep.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h
index b8a835fd611b..827722c21797 100644
--- a/include/linux/lockdep.h
+++ b/include/linux/lockdep.h
@@ -628,6 +628,13 @@ do { \
lock_acquire(&(lock)->dep_map, 0, 0, 1, 1, NULL, _THIS_IP_); \
lock_release(&(lock)->dep_map, 0, _THIS_IP_); \
} while (0)
+# define might_lock_nested(lock, subclass) \
+do { \
+ typecheck(struct lockdep_map *, &(lock)->dep_map); \
+ lock_acquire(&(lock)->dep_map, subclass, 0, 1, 1, NULL, \
+ _THIS_IP_); \
+ lock_release(&(lock)->dep_map, 0, _THIS_IP_); \
+} while (0)
#define lockdep_assert_irqs_enabled() do { \
WARN_ONCE(debug_locks && !current->lockdep_recursion && \
@@ -650,6 +657,7 @@ do { \
#else
# define might_lock(lock) do { } while (0)
# define might_lock_read(lock) do { } while (0)
+# define might_lock_nested(lock, subclass) do { } while (0)
# define lockdep_assert_irqs_enabled() do { } while (0)
# define lockdep_assert_irqs_disabled() do { } while (0)
# define lockdep_assert_in_irq() do { } while (0)