Skip to content

Commit

Permalink
Revert "serial: clps711x: Give a chance to perform useful tasks durin…
Browse files Browse the repository at this point in the history
…g wait loop"

This reverts commit 63e3ad3,
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>
  • Loading branch information
Alexander Shiyan authored and Greg Kroah-Hartman committed Apr 16, 2014
1 parent 717f3bb commit 2f310b8
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions drivers/tty/serial/clps711x.c
Original file line number Diff line number Diff line change
Expand Up @@ -368,16 +368,12 @@ static const struct uart_ops uart_clps711x_ops = {
static void uart_clps711x_console_putchar(struct uart_port *port, int ch)
{
struct clps711x_port *s = dev_get_drvdata(port->dev);
u32 sysflg = 0;

/* Wait for FIFO is not full */
while (1) {
u32 sysflg = 0;

do {
regmap_read(s->syscon, SYSFLG_OFFSET, &sysflg);
if (!(sysflg & SYSFLG_UTXFF))
break;
cond_resched();
}
} while (sysflg & SYSFLG_UTXFF);

writew(ch, port->membase + UARTDR_OFFSET);
}
Expand All @@ -387,18 +383,14 @@ static void uart_clps711x_console_write(struct console *co, const char *c,
{
struct uart_port *port = clps711x_uart.state[co->index].uart_port;
struct clps711x_port *s = dev_get_drvdata(port->dev);
u32 sysflg = 0;

uart_console_write(port, c, n, uart_clps711x_console_putchar);

/* Wait for transmitter to become empty */
while (1) {
u32 sysflg = 0;

do {
regmap_read(s->syscon, SYSFLG_OFFSET, &sysflg);
if (!(sysflg & SYSFLG_UBUSY))
break;
cond_resched();
}
} while (sysflg & SYSFLG_UBUSY);
}

static int uart_clps711x_console_setup(struct console *co, char *options)
Expand Down

0 comments on commit 2f310b8

Please sign in to comment.