diff options
author | Dave Airlie <airlied@redhat.com> | 2013-02-08 03:07:01 +0100 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2013-02-08 03:07:01 +0100 |
commit | 5845b81bdad374f98f809a658ec747d92c9595c4 (patch) | |
tree | ba2449b931bb0bedd66194d93bb4d6d4baae4ce2 /kernel | |
parent | fbcon: fix locking harder (diff) | |
download | linux-5845b81bdad374f98f809a658ec747d92c9595c4.tar.xz linux-5845b81bdad374f98f809a658ec747d92c9595c4.zip |
Revert "Revert "console: implement lockdep support for console_lock""
This reverts commit ff0d05bf73620eb7dc8aee7423e992ef87870bdf.
Now that we have all the locking fixes in place, we can revert the
revert. This re-enables lockdep tracking for the console lock,
daee779718a319ff9f83e1ba3339334ac650bb22.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/printk.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/kernel/printk.c b/kernel/printk.c index 267ce780abe8..357f714ddd49 100644 --- a/kernel/printk.c +++ b/kernel/printk.c @@ -87,6 +87,12 @@ static DEFINE_SEMAPHORE(console_sem); struct console *console_drivers; EXPORT_SYMBOL_GPL(console_drivers); +#ifdef CONFIG_LOCKDEP +static struct lockdep_map console_lock_dep_map = { + .name = "console_lock" +}; +#endif + /* * This is used for debugging the mess that is the VT code by * keeping track if we have the console semaphore held. It's @@ -1918,6 +1924,7 @@ void console_lock(void) return; console_locked = 1; console_may_schedule = 1; + mutex_acquire(&console_lock_dep_map, 0, 0, _RET_IP_); } EXPORT_SYMBOL(console_lock); @@ -1939,6 +1946,7 @@ int console_trylock(void) } console_locked = 1; console_may_schedule = 0; + mutex_acquire(&console_lock_dep_map, 0, 1, _RET_IP_); return 1; } EXPORT_SYMBOL(console_trylock); @@ -2099,6 +2107,7 @@ skip: local_irq_restore(flags); } console_locked = 0; + mutex_release(&console_lock_dep_map, 1, _RET_IP_); /* Release the exclusive_console once it is used */ if (unlikely(exclusive_console)) |