aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/char/vt.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/char/vt.c b/drivers/char/vt.c
index 7a5badfb7d84..367be9175061 100644
--- a/drivers/char/vt.c
+++ b/drivers/char/vt.c
@@ -2400,13 +2400,15 @@ static void vt_console_print(struct console *co, const char *b, unsigned count)
2400{ 2400{
2401 struct vc_data *vc = vc_cons[fg_console].d; 2401 struct vc_data *vc = vc_cons[fg_console].d;
2402 unsigned char c; 2402 unsigned char c;
2403 static unsigned long printing; 2403 static DEFINE_SPINLOCK(printing_lock);
2404 const ushort *start; 2404 const ushort *start;
2405 ushort cnt = 0; 2405 ushort cnt = 0;
2406 ushort myx; 2406 ushort myx;
2407 2407
2408 /* console busy or not yet initialized */ 2408 /* console busy or not yet initialized */
2409 if (!printable || test_and_set_bit(0, &printing)) 2409 if (!printable)
2410 return;
2411 if (!spin_trylock(&printing_lock))
2410 return; 2412 return;
2411 2413
2412 if (kmsg_redirect && vc_cons_allocated(kmsg_redirect - 1)) 2414 if (kmsg_redirect && vc_cons_allocated(kmsg_redirect - 1))
@@ -2481,7 +2483,7 @@ static void vt_console_print(struct console *co, const char *b, unsigned count)
2481 notify_update(vc); 2483 notify_update(vc);
2482 2484
2483quit: 2485quit:
2484 clear_bit(0, &printing); 2486 spin_unlock(&printing_lock);
2485} 2487}
2486 2488
2487static struct tty_driver *vt_console_device(struct console *c, int *index) 2489static struct tty_driver *vt_console_device(struct console *c, int *index)