summaryrefslogtreecommitdiffstats
path: root/drivers/serial
diff options
context:
space:
mode:
authorJason Wessel <jason.wessel@windriver.com>2010-05-20 21:04:26 -0500
committerJason Wessel <jason.wessel@windriver.com>2010-05-20 21:04:26 -0500
commitefe2f29e324fd20e0449bcd6dc6dbe4734c2ba94 (patch)
treeff8b2d7eddbfee39aebf7a43c6125202b6bda6d7 /drivers/serial
parent1cee5e35f15d0893be1ba944f1aec8676e43ab76 (diff)
downloadblackbird-op-linux-efe2f29e324fd20e0449bcd6dc6dbe4734c2ba94.tar.gz
blackbird-op-linux-efe2f29e324fd20e0449bcd6dc6dbe4734c2ba94.zip
kgdboc,kdb: Allow kdb to work on a non open console port
If kdb is open on a serial port that is not actually a console make sure to call the poll routines to emit and receive characters. Signed-off-by: Jason Wessel <jason.wessel@windriver.com> Acked-by: Martin Hicks <mort@sgi.com>
Diffstat (limited to 'drivers/serial')
-rw-r--r--drivers/serial/kgdboc.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/serial/kgdboc.c b/drivers/serial/kgdboc.c
index ecef6e1a599a..b765ab48dfe7 100644
--- a/drivers/serial/kgdboc.c
+++ b/drivers/serial/kgdboc.c
@@ -16,6 +16,7 @@
#include <linux/kgdb.h>
#include <linux/kdb.h>
#include <linux/tty.h>
+#include <linux/console.h>
#define MAX_CONFIG_LEN 40
@@ -93,12 +94,14 @@ static int configure_kgdboc(void)
int tty_line = 0;
int err;
char *cptr = config;
+ struct console *cons;
err = kgdboc_option_setup(config);
if (err || !strlen(config) || isspace(config[0]))
goto noconfig;
err = -ENODEV;
+ kgdboc_io_ops.is_console = 0;
kgdb_tty_driver = NULL;
if (kgdboc_register_kbd(&cptr))
@@ -108,6 +111,17 @@ static int configure_kgdboc(void)
if (!p)
goto noconfig;
+ cons = console_drivers;
+ while (cons) {
+ int idx;
+ if (cons->device && cons->device(cons, &idx) == p &&
+ idx == tty_line) {
+ kgdboc_io_ops.is_console = 1;
+ break;
+ }
+ cons = cons->next;
+ }
+
kgdb_tty_driver = p;
kgdb_tty_line = tty_line;
OpenPOWER on IntegriCloud