From 0d6e5b7998251ffc58e5aba4244b94f0830a0e92 Mon Sep 17 00:00:00 2001 From: Nick Piggin Date: Wed, 6 Feb 2008 01:37:04 -0800 Subject: [PATCH] --- yaml --- r: 83421 b: refs/heads/master c: b0940003f25dd3d2c54c4879809a432a35197f54 h: refs/heads/master i: 83419: 34c265c2ef357565f5f9979df96eda5cd33242b9 v: v3 --- [refs] | 2 +- trunk/drivers/char/vt.c | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index be9084786940..3f5f956030e4 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 5bd91f18be2fc0dd0384fbfca6d3cdd79a8050dd +refs/heads/master: b0940003f25dd3d2c54c4879809a432a35197f54 diff --git a/trunk/drivers/char/vt.c b/trunk/drivers/char/vt.c index 7a5badfb7d84..367be9175061 100644 --- a/trunk/drivers/char/vt.c +++ b/trunk/drivers/char/vt.c @@ -2400,13 +2400,15 @@ static void vt_console_print(struct console *co, const char *b, unsigned count) { struct vc_data *vc = vc_cons[fg_console].d; unsigned char c; - static unsigned long printing; + static DEFINE_SPINLOCK(printing_lock); const ushort *start; ushort cnt = 0; ushort myx; /* console busy or not yet initialized */ - if (!printable || test_and_set_bit(0, &printing)) + if (!printable) + return; + if (!spin_trylock(&printing_lock)) return; 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) notify_update(vc); quit: - clear_bit(0, &printing); + spin_unlock(&printing_lock); } static struct tty_driver *vt_console_device(struct console *c, int *index)