diff options
author | Dave Airlie <airlied@redhat.com> | 2013-02-07 21:07:01 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2013-02-07 21:07:01 -0500 |
commit | 5845b81bdad374f98f809a658ec747d92c9595c4 (patch) | |
tree | ba2449b931bb0bedd66194d93bb4d6d4baae4ce2 /kernel | |
parent | 054430e773c9a1e26f38e30156eff02dedfffc17 (diff) |
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); | |||
87 | struct console *console_drivers; | 87 | struct console *console_drivers; |
88 | EXPORT_SYMBOL_GPL(console_drivers); | 88 | EXPORT_SYMBOL_GPL(console_drivers); |
89 | 89 | ||
90 | #ifdef CONFIG_LOCKDEP | ||
91 | static struct lockdep_map console_lock_dep_map = { | ||
92 | .name = "console_lock" | ||
93 | }; | ||
94 | #endif | ||
95 | |||
90 | /* | 96 | /* |
91 | * This is used for debugging the mess that is the VT code by | 97 | * This is used for debugging the mess that is the VT code by |
92 | * keeping track if we have the console semaphore held. It's | 98 | * keeping track if we have the console semaphore held. It's |
@@ -1918,6 +1924,7 @@ void console_lock(void) | |||
1918 | return; | 1924 | return; |
1919 | console_locked = 1; | 1925 | console_locked = 1; |
1920 | console_may_schedule = 1; | 1926 | console_may_schedule = 1; |
1927 | mutex_acquire(&console_lock_dep_map, 0, 0, _RET_IP_); | ||
1921 | } | 1928 | } |
1922 | EXPORT_SYMBOL(console_lock); | 1929 | EXPORT_SYMBOL(console_lock); |
1923 | 1930 | ||
@@ -1939,6 +1946,7 @@ int console_trylock(void) | |||
1939 | } | 1946 | } |
1940 | console_locked = 1; | 1947 | console_locked = 1; |
1941 | console_may_schedule = 0; | 1948 | console_may_schedule = 0; |
1949 | mutex_acquire(&console_lock_dep_map, 0, 1, _RET_IP_); | ||
1942 | return 1; | 1950 | return 1; |
1943 | } | 1951 | } |
1944 | EXPORT_SYMBOL(console_trylock); | 1952 | EXPORT_SYMBOL(console_trylock); |
@@ -2099,6 +2107,7 @@ skip: | |||
2099 | local_irq_restore(flags); | 2107 | local_irq_restore(flags); |
2100 | } | 2108 | } |
2101 | console_locked = 0; | 2109 | console_locked = 0; |
2110 | mutex_release(&console_lock_dep_map, 1, _RET_IP_); | ||
2102 | 2111 | ||
2103 | /* Release the exclusive_console once it is used */ | 2112 | /* Release the exclusive_console once it is used */ |
2104 | if (unlikely(exclusive_console)) | 2113 | if (unlikely(exclusive_console)) |