diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2017-12-20 13:16:23 +1100 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2017-12-20 22:15:36 -0600 |
commit | 76d9bcdca58936d761458f8f05960239c4dd8dec (patch) | |
tree | c8377b11be33e62d312810645b8044d3a6f427aa /core/timebase.c | |
parent | ca612b802adac0c72cd0f10c51a51275e5914101 (diff) | |
download | blackbird-skiboot-76d9bcdca58936d761458f8f05960239c4dd8dec.tar.gz blackbird-skiboot-76d9bcdca58936d761458f8f05960239c4dd8dec.zip |
lock: Add additional lock auditing code
Keep track of lock owner name and replace lock_depth counter
with a per-cpu list of locks held by the cpu.
This allows us to print the actual locks held in case we hit
the (in)famous message about opal_pollers being run with a
lock held.
It also allows us to warn (and drop them) if locks are still
held when returning to the OS or completing a scheduled job.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Reviewed-by: Nicholas Piggin <npiggin@gmail.com>
[stewart: fix unit tests]
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'core/timebase.c')
-rw-r--r-- | core/timebase.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/timebase.c b/core/timebase.c index f2dff44b..777e4ba6 100644 --- a/core/timebase.c +++ b/core/timebase.c @@ -53,7 +53,7 @@ void time_wait(unsigned long duration) { struct cpu_thread *c = this_cpu(); - if (this_cpu()->lock_depth) { + if (!list_empty(&this_cpu()->locks_held)) { time_wait_nopoll(duration); return; } |