Skip to content

Commit

Permalink
lockdep/selftests: Fix selftests vs PROVE_RAW_LOCK_NESTING
Browse files Browse the repository at this point in the history
[ Upstream commit c0c2c0d ]

When PROVE_RAW_LOCK_NESTING=y many of the selftests FAILED because
HARDIRQ context is out-of-bounds for spinlocks. Instead make the
default hardware context the threaded hardirq context, which preserves
the old locking rules.

The wait-type specific locking selftests will have a non-threaded
HARDIRQ variant.

Fixes: de8f5e4 ("lockdep: Introduce wait-type checks")
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Tested-by: Joerg Roedel <jroedel@suse.de>
Link: https://lore.kernel.org/r/20210617190313.322096283@infradead.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Peter Zijlstra authored and gregkh committed Jul 14, 2021
1 parent 5fd218d commit a2c53d9
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/locking-selftest.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ static void init_shared_classes(void)
#define HARDIRQ_ENTER() \
local_irq_disable(); \
__irq_enter(); \
lockdep_hardirq_threaded(); \
WARN_ON(!in_irq());

#define HARDIRQ_EXIT() \
Expand Down

0 comments on commit a2c53d9

Please sign in to comment.