summaryrefslogtreecommitdiff
path: root/kernel/locking/lockdep.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2020-08-03 14:00:27 +0300
committerIngo Molnar <mingo@kernel.org>2020-08-03 14:00:27 +0300
commit992414a18cd4de05fa3f8ff7e1c29af758bdee1a (patch)
tree60115684b3617ebb555678baf5d31a8d02d1df36 /kernel/locking/lockdep.c
parenta68415c27ff366970be132c266aa859ad706af33 (diff)
parented00495333ccc80fc8fb86fb43773c3c2a499466 (diff)
downloadlinux-992414a18cd4de05fa3f8ff7e1c29af758bdee1a.tar.xz
Merge branch 'locking/nmi' into locking/core, to pick up completed topic branch
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel/locking/lockdep.c')
-rw-r--r--kernel/locking/lockdep.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
index 7b5800374c40..b4d34c9030df 100644
--- a/kernel/locking/lockdep.c
+++ b/kernel/locking/lockdep.c
@@ -3714,6 +3714,9 @@ void noinstr lockdep_hardirqs_on(unsigned long ip)
* and not rely on hardware state like normal interrupts.
*/
if (unlikely(in_nmi())) {
+ if (!IS_ENABLED(CONFIG_TRACE_IRQFLAGS_NMI))
+ return;
+
/*
* Skip:
* - recursion check, because NMI can hit lockdep;
@@ -3773,7 +3776,10 @@ void noinstr lockdep_hardirqs_off(unsigned long ip)
* they will restore the software state. This ensures the software
* state is consistent inside NMIs as well.
*/
- if (unlikely(!in_nmi() && (current->lockdep_recursion & LOCKDEP_RECURSION_MASK)))
+ if (in_nmi()) {
+ if (!IS_ENABLED(CONFIG_TRACE_IRQFLAGS_NMI))
+ return;
+ } else if (current->lockdep_recursion & LOCKDEP_RECURSION_MASK)
return;
/*