diff options
Diffstat (limited to 'drivers/tty/serial/sh-sci.c')
-rw-r--r-- | drivers/tty/serial/sh-sci.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c index f8db8a70c14e..bf461cf99616 100644 --- a/drivers/tty/serial/sh-sci.c +++ b/drivers/tty/serial/sh-sci.c | |||
@@ -1229,17 +1229,20 @@ static void sci_dma_tx_complete(void *arg) | |||
1229 | port->icount.tx += sg_dma_len(&s->sg_tx); | 1229 | port->icount.tx += sg_dma_len(&s->sg_tx); |
1230 | 1230 | ||
1231 | async_tx_ack(s->desc_tx); | 1231 | async_tx_ack(s->desc_tx); |
1232 | s->cookie_tx = -EINVAL; | ||
1233 | s->desc_tx = NULL; | 1232 | s->desc_tx = NULL; |
1234 | 1233 | ||
1235 | if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS) | 1234 | if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS) |
1236 | uart_write_wakeup(port); | 1235 | uart_write_wakeup(port); |
1237 | 1236 | ||
1238 | if (!uart_circ_empty(xmit)) { | 1237 | if (!uart_circ_empty(xmit)) { |
1238 | s->cookie_tx = 0; | ||
1239 | schedule_work(&s->work_tx); | 1239 | schedule_work(&s->work_tx); |
1240 | } else if (port->type == PORT_SCIFA || port->type == PORT_SCIFB) { | 1240 | } else { |
1241 | u16 ctrl = sci_in(port, SCSCR); | 1241 | s->cookie_tx = -EINVAL; |
1242 | sci_out(port, SCSCR, ctrl & ~SCSCR_TIE); | 1242 | if (port->type == PORT_SCIFA || port->type == PORT_SCIFB) { |
1243 | u16 ctrl = sci_in(port, SCSCR); | ||
1244 | sci_out(port, SCSCR, ctrl & ~SCSCR_TIE); | ||
1245 | } | ||
1243 | } | 1246 | } |
1244 | 1247 | ||
1245 | spin_unlock_irqrestore(&port->lock, flags); | 1248 | spin_unlock_irqrestore(&port->lock, flags); |
@@ -1501,8 +1504,10 @@ static void sci_start_tx(struct uart_port *port) | |||
1501 | } | 1504 | } |
1502 | 1505 | ||
1503 | if (s->chan_tx && !uart_circ_empty(&s->port.state->xmit) && | 1506 | if (s->chan_tx && !uart_circ_empty(&s->port.state->xmit) && |
1504 | s->cookie_tx < 0) | 1507 | s->cookie_tx < 0) { |
1508 | s->cookie_tx = 0; | ||
1505 | schedule_work(&s->work_tx); | 1509 | schedule_work(&s->work_tx); |
1510 | } | ||
1506 | #endif | 1511 | #endif |
1507 | 1512 | ||
1508 | if (!s->chan_tx || port->type == PORT_SCIFA || port->type == PORT_SCIFB) { | 1513 | if (!s->chan_tx || port->type == PORT_SCIFA || port->type == PORT_SCIFB) { |