A couple of locking fixes:

 - Fix incorrect failure injection handling on the fuxtex code

 - Prevent a preemption warning in lockdep when tracking local_irq_enable()
   and interrupts are already enabled

 - Remove more raw_cpu_read() usage from lockdep which causes state
   corruption on !X86 architectures.

 - Make the nr_unused_locks accounting in lockdep correct again.
lockdep: Fix nr_unused_locks accounting

Chris reported that commit 24d5a3bffef1 ("lockdep: Fix
usage_traceoverflow") breaks the nr_unused_locks validation code
triggered by /proc/lockdep_stats.

By fully splitting LOCK_USED and LOCK_USED_READ it becomes a bad
indicator for accounting nr_unused_locks; simplyfy by using any first
bit.

Fixes: 24d5a3bffef1 ("lockdep: Fix usage_traceoverflow")
Reported-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Tested-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: https://lkml.kernel.org/r/20201027124834.GL2628@hirez.programming.kicks-ass.net
1 file changed