aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/serial
diff options
context:
space:
mode:
authorAlexander Shiyan <shc_work@mail.ru>2014-03-11 07:30:01 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-03-17 19:13:24 -0400
commit63e3ad3252695a2b8c01b6f6c225e4537af08b85 (patch)
treebd4d67034f7f8b435d9be8c985dcedb9210f17af /drivers/tty/serial
parent015355b70e074a8cc11da6ae4f82d45c5160358a (diff)
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: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/serial')
-rw-r--r--drivers/tty/serial/clps711x.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/drivers/tty/serial/clps711x.c b/drivers/tty/serial/clps711x.c
index b0eacb83f831..5e6fdb1ea73b 100644
--- a/drivers/tty/serial/clps711x.c
+++ b/drivers/tty/serial/clps711x.c
@@ -368,11 +368,16 @@ static const struct uart_ops uart_clps711x_ops = {
368static void uart_clps711x_console_putchar(struct uart_port *port, int ch) 368static void uart_clps711x_console_putchar(struct uart_port *port, int ch)
369{ 369{
370 struct clps711x_port *s = dev_get_drvdata(port->dev); 370 struct clps711x_port *s = dev_get_drvdata(port->dev);
371 u32 sysflg = 0;
372 371
373 do { 372 /* Wait for FIFO is not full */
373 while (1) {
374 u32 sysflg = 0;
375
374 regmap_read(s->syscon, SYSFLG_OFFSET, &sysflg); 376 regmap_read(s->syscon, SYSFLG_OFFSET, &sysflg);
375 } while (sysflg & SYSFLG_UTXFF); 377 if (!(sysflg & SYSFLG_UTXFF))
378 break;
379 cond_resched();
380 }
376 381
377 writew(ch, port->membase + UARTDR_OFFSET); 382 writew(ch, port->membase + UARTDR_OFFSET);
378} 383}
@@ -382,14 +387,18 @@ static void uart_clps711x_console_write(struct console *co, const char *c,
382{ 387{
383 struct uart_port *port = clps711x_uart.state[co->index].uart_port; 388 struct uart_port *port = clps711x_uart.state[co->index].uart_port;
384 struct clps711x_port *s = dev_get_drvdata(port->dev); 389 struct clps711x_port *s = dev_get_drvdata(port->dev);
385 u32 sysflg = 0;
386 390
387 uart_console_write(port, c, n, uart_clps711x_console_putchar); 391 uart_console_write(port, c, n, uart_clps711x_console_putchar);
388 392
389 /* Wait for transmitter to become empty */ 393 /* Wait for transmitter to become empty */
390 do { 394 while (1) {
395 u32 sysflg = 0;
396
391 regmap_read(s->syscon, SYSFLG_OFFSET, &sysflg); 397 regmap_read(s->syscon, SYSFLG_OFFSET, &sysflg);
392 } while (sysflg & SYSFLG_UBUSY); 398 if (!(sysflg & SYSFLG_UBUSY))
399 break;
400 cond_resched();
401 }
393} 402}
394 403
395static int uart_clps711x_console_setup(struct console *co, char *options) 404static int uart_clps711x_console_setup(struct console *co, char *options)