From: Peter Zijlstra Date: Thu, 17 Jun 2021 18:57:19 +0000 (+0200) Subject: lockdep/selftests: Fix selftests vs PROVE_RAW_LOCK_NESTING X-Git-Tag: v5.10.50~328 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f18f7a2276979e1ce3183152d560ca89ef97e73f;p=thirdparty%2Fkernel%2Fstable.git lockdep/selftests: Fix selftests vs PROVE_RAW_LOCK_NESTING [ Upstream commit c0c2c0dad6a06e0c05e9a52d65f932bd54364c97 ] 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: de8f5e4f2dc1 ("lockdep: Introduce wait-type checks") Signed-off-by: Peter Zijlstra (Intel) Tested-by: Joerg Roedel Link: https://lore.kernel.org/r/20210617190313.322096283@infradead.org Signed-off-by: Sasha Levin --- diff --git a/lib/locking-selftest.c b/lib/locking-selftest.c index a899b3f0e2e53..76c52b0b76d38 100644 --- a/lib/locking-selftest.c +++ b/lib/locking-selftest.c @@ -186,6 +186,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() \