Commit 63e3ad32 authored by Alexander Shiyan's avatar Alexander Shiyan Committed by Greg Kroah-Hartman

serial: clps711x: Give a chance to perform useful tasks during wait loop

This patch adds cond_sched() calls during wait loop to perform
other tasks.
Signed-off-by: default avatarAlexander Shiyan <shc_work@mail.ru>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 015355b7
...@@ -368,11 +368,16 @@ static const struct uart_ops uart_clps711x_ops = { ...@@ -368,11 +368,16 @@ static const struct uart_ops uart_clps711x_ops = {
static void uart_clps711x_console_putchar(struct uart_port *port, int ch) static void uart_clps711x_console_putchar(struct uart_port *port, int ch)
{ {
struct clps711x_port *s = dev_get_drvdata(port->dev); struct clps711x_port *s = dev_get_drvdata(port->dev);
u32 sysflg = 0;
do { /* Wait for FIFO is not full */
while (1) {
u32 sysflg = 0;
regmap_read(s->syscon, SYSFLG_OFFSET, &sysflg); regmap_read(s->syscon, SYSFLG_OFFSET, &sysflg);
} while (sysflg & SYSFLG_UTXFF); if (!(sysflg & SYSFLG_UTXFF))
break;
cond_resched();
}
writew(ch, port->membase + UARTDR_OFFSET); writew(ch, port->membase + UARTDR_OFFSET);
} }
...@@ -382,14 +387,18 @@ static void uart_clps711x_console_write(struct console *co, const char *c, ...@@ -382,14 +387,18 @@ static void uart_clps711x_console_write(struct console *co, const char *c,
{ {
struct uart_port *port = clps711x_uart.state[co->index].uart_port; struct uart_port *port = clps711x_uart.state[co->index].uart_port;
struct clps711x_port *s = dev_get_drvdata(port->dev); struct clps711x_port *s = dev_get_drvdata(port->dev);
u32 sysflg = 0;
uart_console_write(port, c, n, uart_clps711x_console_putchar); uart_console_write(port, c, n, uart_clps711x_console_putchar);
/* Wait for transmitter to become empty */ /* Wait for transmitter to become empty */
do { while (1) {
u32 sysflg = 0;
regmap_read(s->syscon, SYSFLG_OFFSET, &sysflg); regmap_read(s->syscon, SYSFLG_OFFSET, &sysflg);
} while (sysflg & SYSFLG_UBUSY); if (!(sysflg & SYSFLG_UBUSY))
break;
cond_resched();
}
} }
static int uart_clps711x_console_setup(struct console *co, char *options) static int uart_clps711x_console_setup(struct console *co, char *options)
......
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