aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/printk.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/kernel/printk.c b/kernel/printk.c
index f24633afa46a..0b31715f335a 100644
--- a/kernel/printk.c
+++ b/kernel/printk.c
@@ -88,6 +88,12 @@ static DEFINE_SEMAPHORE(console_sem);
88struct console *console_drivers; 88struct console *console_drivers;
89EXPORT_SYMBOL_GPL(console_drivers); 89EXPORT_SYMBOL_GPL(console_drivers);
90 90
91#ifdef CONFIG_LOCKDEP
92static struct lockdep_map console_lock_dep_map = {
93 .name = "console_lock"
94};
95#endif
96
91/* 97/*
92 * This is used for debugging the mess that is the VT code by 98 * This is used for debugging the mess that is the VT code by
93 * keeping track if we have the console semaphore held. It's 99 * keeping track if we have the console semaphore held. It's
@@ -1919,6 +1925,7 @@ void console_lock(void)
1919 return; 1925 return;
1920 console_locked = 1; 1926 console_locked = 1;
1921 console_may_schedule = 1; 1927 console_may_schedule = 1;
1928 mutex_acquire(&console_lock_dep_map, 0, 0, _RET_IP_);
1922} 1929}
1923EXPORT_SYMBOL(console_lock); 1930EXPORT_SYMBOL(console_lock);
1924 1931
@@ -1940,6 +1947,7 @@ int console_trylock(void)
1940 } 1947 }
1941 console_locked = 1; 1948 console_locked = 1;
1942 console_may_schedule = 0; 1949 console_may_schedule = 0;
1950 mutex_acquire(&console_lock_dep_map, 0, 1, _RET_IP_);
1943 return 1; 1951 return 1;
1944} 1952}
1945EXPORT_SYMBOL(console_trylock); 1953EXPORT_SYMBOL(console_trylock);
@@ -2102,6 +2110,7 @@ skip:
2102 local_irq_restore(flags); 2110 local_irq_restore(flags);
2103 } 2111 }
2104 console_locked = 0; 2112 console_locked = 0;
2113 mutex_release(&console_lock_dep_map, 1, _RET_IP_);
2105 2114
2106 /* Release the exclusive_console once it is used */ 2115 /* Release the exclusive_console once it is used */
2107 if (unlikely(exclusive_console)) 2116 if (unlikely(exclusive_console))