aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Shiyan <shc_work@mail.ru>2014-03-27 05:38:19 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-04-16 17:17:44 -0400
commit2f310b8e418ac5eb3833a9f36791c24a97f1f557 (patch)
treed3ea8c54020a2f5eedef8eed9e995e7c5c329ef3
parent717f3bbab3c7628736ef738fdbf3d9a28578c26c (diff)
Revert "serial: clps711x: Give a chance to perform useful tasks during wait loop"
This reverts commit 63e3ad3252695a2b8c01b6f6c225e4537af08b85, since this not works as expected and produce runtime error: BUG: sleeping function called from invalid context at drivers/tty/serial/clps711x.c:379 in_atomic(): 0, irqs_disabled(): 128, pid: 287, name: mount Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/tty/serial/clps711x.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/drivers/tty/serial/clps711x.c b/drivers/tty/serial/clps711x.c
index 5e6fdb1ea73b..14aaea0d4131 100644
--- a/drivers/tty/serial/clps711x.c
+++ b/drivers/tty/serial/clps711x.c
@@ -368,16 +368,12 @@ 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;
371 372
372 /* Wait for FIFO is not full */ 373 /* Wait for FIFO is not full */
373 while (1) { 374 do {
374 u32 sysflg = 0;
375
376 regmap_read(s->syscon, SYSFLG_OFFSET, &sysflg); 375 regmap_read(s->syscon, SYSFLG_OFFSET, &sysflg);
377 if (!(sysflg & SYSFLG_UTXFF)) 376 } while (sysflg & SYSFLG_UTXFF);
378 break;
379 cond_resched();
380 }
381 377
382 writew(ch, port->membase + UARTDR_OFFSET); 378 writew(ch, port->membase + UARTDR_OFFSET);
383} 379}
@@ -387,18 +383,14 @@ static void uart_clps711x_console_write(struct console *co, const char *c,
387{ 383{
388 struct uart_port *port = clps711x_uart.state[co->index].uart_port; 384 struct uart_port *port = clps711x_uart.state[co->index].uart_port;
389 struct clps711x_port *s = dev_get_drvdata(port->dev); 385 struct clps711x_port *s = dev_get_drvdata(port->dev);
386 u32 sysflg = 0;
390 387
391 uart_console_write(port, c, n, uart_clps711x_console_putchar); 388 uart_console_write(port, c, n, uart_clps711x_console_putchar);
392 389
393 /* Wait for transmitter to become empty */ 390 /* Wait for transmitter to become empty */
394 while (1) { 391 do {
395 u32 sysflg = 0;
396
397 regmap_read(s->syscon, SYSFLG_OFFSET, &sysflg); 392 regmap_read(s->syscon, SYSFLG_OFFSET, &sysflg);
398 if (!(sysflg & SYSFLG_UBUSY)) 393 } while (sysflg & SYSFLG_UBUSY);
399 break;
400 cond_resched();
401 }
402} 394}
403 395
404static int uart_clps711x_console_setup(struct console *co, char *options) 396static int uart_clps711x_console_setup(struct console *co, char *options)