summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorJason Wessel <jason.wessel@windriver.com>2011-07-28 12:42:23 -0500
committerClark Williams <williams@redhat.com>2012-03-07 16:15:15 -0600
commit79fd0d6814967cf8c2b50a688ca76ed47920586b (patch)
treea43a6fd31e84882a1f647e26c538abafbf82cfc9 /drivers
parentf33b89c6fb3e500e9ee19ea6e4183ef637a05492 (diff)
kgdb/serial: Short term workaround
On 07/27/2011 04:37 PM, Thomas Gleixner wrote: > - KGDB (not yet disabled) is reportedly unusable on -rt right now due > to missing hacks in the console locking which I dropped on purpose. > To work around this in the short term you can use this patch, in addition to the clocksource watchdog patch that Thomas brewed up. Comments are welcome of course. Ultimately the right solution is to change separation between the console and the HW to have a polled mode + work queue so as not to introduce any kind of latency. Thanks, Jason.
Diffstat (limited to 'drivers')
-rw-r--r--drivers/tty/serial/8250.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/tty/serial/8250.c b/drivers/tty/serial/8250.c
index 3bf482cb7f51..0596a359d30c 100644
--- a/drivers/tty/serial/8250.c
+++ b/drivers/tty/serial/8250.c
@@ -38,6 +38,7 @@
#include <linux/nmi.h>
#include <linux/mutex.h>
#include <linux/slab.h>
+#include <linux/kdb.h>
#include <asm/io.h>
#include <asm/irq.h>
@@ -2855,10 +2856,14 @@ serial8250_console_write(struct console *co, const char *s, unsigned int count)
touch_nmi_watchdog();
- if (up->port.sysrq || oops_in_progress)
- locked = spin_trylock_irqsave(&up->port.lock, flags);
- else
- spin_lock_irqsave(&up->port.lock, flags);
+ if (unlikely(in_kdb_printk())) {
+ locked = 0;
+ } else {
+ if (up->port.sysrq || oops_in_progress)
+ locked = spin_trylock_irqsave(&up->port.lock, flags);
+ else
+ spin_lock_irqsave(&up->port.lock, flags);
+ }
/*
* First save the IER then disable the interrupts