Commit be28c1e3 authored by Christophe Leroy's avatar Christophe Leroy Committed by Greg Kroah-Hartman

serial: cpm_uart: return immediately from console poll

kgdb expects poll function to return immediately and
returning NO_POLL_CHAR when no character is available.

Fixes: f5316b4a ("kgdb,8250,pl011: Return immediately from console poll")
Cc: Jason Wessel <jason.wessel@windriver.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: default avatarChristophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 3216c622
...@@ -1054,8 +1054,8 @@ static int poll_wait_key(char *obuf, struct uart_cpm_port *pinfo) ...@@ -1054,8 +1054,8 @@ static int poll_wait_key(char *obuf, struct uart_cpm_port *pinfo)
/* Get the address of the host memory buffer. /* Get the address of the host memory buffer.
*/ */
bdp = pinfo->rx_cur; bdp = pinfo->rx_cur;
while (bdp->cbd_sc & BD_SC_EMPTY) if (bdp->cbd_sc & BD_SC_EMPTY)
; return NO_POLL_CHAR;
/* If the buffer address is in the CPM DPRAM, don't /* If the buffer address is in the CPM DPRAM, don't
* convert it. * convert it.
...@@ -1090,7 +1090,11 @@ static int cpm_get_poll_char(struct uart_port *port) ...@@ -1090,7 +1090,11 @@ static int cpm_get_poll_char(struct uart_port *port)
poll_chars = 0; poll_chars = 0;
} }
if (poll_chars <= 0) { if (poll_chars <= 0) {
poll_chars = poll_wait_key(poll_buf, pinfo); int ret = poll_wait_key(poll_buf, pinfo);
if (ret == NO_POLL_CHAR)
return ret;
poll_chars = ret;
pollp = poll_buf; pollp = poll_buf;
} }
poll_chars--; poll_chars--;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment