diff options
author | Jason Wessel <jason.wessel@windriver.com> | 2012-08-12 08:16:43 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-08-16 15:20:20 -0400 |
commit | 38f8eefccf3a23c4058a570fa2938a4f553cf8e0 (patch) | |
tree | 6cfaa19aa7470639e3d5ab54694200d93c4b4005 /drivers/tty | |
parent | 00592021010ad86d3b26bac7034034f6af145a2c (diff) |
pmac_zilog,kdb: Fix console poll hook to return instead of loop
kdb <-> kgdb transitioning does not work properly with this UART
driver because the get character routine loops indefinitely as opposed
to returning NO_POLL_CHAR per the expectation of the KDB I/O driver
API.
The symptom is a kernel hang when trying to switch debug modes.
Cc: Alan Cox <alan@linux.intel.com>
Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r-- | drivers/tty/serial/pmac_zilog.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/tty/serial/pmac_zilog.c b/drivers/tty/serial/pmac_zilog.c index 654755a990df..333c8d012b0e 100644 --- a/drivers/tty/serial/pmac_zilog.c +++ b/drivers/tty/serial/pmac_zilog.c | |||
@@ -1348,10 +1348,16 @@ static int pmz_verify_port(struct uart_port *port, struct serial_struct *ser) | |||
1348 | static int pmz_poll_get_char(struct uart_port *port) | 1348 | static int pmz_poll_get_char(struct uart_port *port) |
1349 | { | 1349 | { |
1350 | struct uart_pmac_port *uap = (struct uart_pmac_port *)port; | 1350 | struct uart_pmac_port *uap = (struct uart_pmac_port *)port; |
1351 | int tries = 2; | ||
1351 | 1352 | ||
1352 | while ((read_zsreg(uap, R0) & Rx_CH_AV) == 0) | 1353 | while (tries) { |
1353 | udelay(5); | 1354 | if ((read_zsreg(uap, R0) & Rx_CH_AV) != 0) |
1354 | return read_zsdata(uap); | 1355 | return read_zsdata(uap); |
1356 | if (tries--) | ||
1357 | udelay(5); | ||
1358 | } | ||
1359 | |||
1360 | return NO_POLL_CHAR; | ||
1355 | } | 1361 | } |
1356 | 1362 | ||
1357 | static void pmz_poll_put_char(struct uart_port *port, unsigned char c) | 1363 | static void pmz_poll_put_char(struct uart_port *port, unsigned char c) |