aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial/kgdboc.c
diff options
context:
space:
mode:
authorJason Wessel <jason.wessel@windriver.com>2010-05-20 22:04:26 -0400
committerJason Wessel <jason.wessel@windriver.com>2010-05-20 22:04:26 -0400
commitefe2f29e324fd20e0449bcd6dc6dbe4734c2ba94 (patch)
treeff8b2d7eddbfee39aebf7a43c6125202b6bda6d7 /drivers/serial/kgdboc.c
parent1cee5e35f15d0893be1ba944f1aec8676e43ab76 (diff)
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/kgdboc.c')
-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 @@
16#include <linux/kgdb.h> 16#include <linux/kgdb.h>
17#include <linux/kdb.h> 17#include <linux/kdb.h>
18#include <linux/tty.h> 18#include <linux/tty.h>
19#include <linux/console.h>
19 20
20#define MAX_CONFIG_LEN 40 21#define MAX_CONFIG_LEN 40
21 22
@@ -93,12 +94,14 @@ static int configure_kgdboc(void)
93 int tty_line = 0; 94 int tty_line = 0;
94 int err; 95 int err;
95 char *cptr = config; 96 char *cptr = config;
97 struct console *cons;
96 98
97 err = kgdboc_option_setup(config); 99 err = kgdboc_option_setup(config);
98 if (err || !strlen(config) || isspace(config[0])) 100 if (err || !strlen(config) || isspace(config[0]))
99 goto noconfig; 101 goto noconfig;
100 102
101 err = -ENODEV; 103 err = -ENODEV;
104 kgdboc_io_ops.is_console = 0;
102 kgdb_tty_driver = NULL; 105 kgdb_tty_driver = NULL;
103 106
104 if (kgdboc_register_kbd(&cptr)) 107 if (kgdboc_register_kbd(&cptr))
@@ -108,6 +111,17 @@ static int configure_kgdboc(void)
108 if (!p) 111 if (!p)
109 goto noconfig; 112 goto noconfig;
110 113
114 cons = console_drivers;
115 while (cons) {
116 int idx;
117 if (cons->device && cons->device(cons, &idx) == p &&
118 idx == tty_line) {
119 kgdboc_io_ops.is_console = 1;
120 break;
121 }
122 cons = cons->next;
123 }
124
111 kgdb_tty_driver = p; 125 kgdb_tty_driver = p;
112 kgdb_tty_line = tty_line; 126 kgdb_tty_line = tty_line;
113 127