Skip to content

Commit

Permalink
serial: exynos: apply TX MASK scheme in tx irq
Browse files Browse the repository at this point in the history
When tty circ_buffer go to START from END, circ_buffer
has residual tx data from START to HEAD. But tx interrupt handler clears
tx irq pending and quits irq handler. So, tx irq handler never called
until start_tx function is called by another process.
TX MASK scheme is MASKING INTR in front side of tx handler and UNMASK at
back side of tx handler. TX UNMASKING can make new tx pending and new tx
irq handler is called to flush circ_buffer.

Change-Id: I71b476c7546fca25291e0c12ab44c1c1f20cdd7a
Signed-off-by: myung-su.cha <[email protected]>
Signed-off-by: Hyunki Koo <[email protected]>
  • Loading branch information
HYUNKI-KOO authored and kyangk committed May 4, 2021
1 parent a67dd5c commit d3a5135
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion drivers/tty/serial/exynos_tty.c
Original file line number Diff line number Diff line change
Expand Up @@ -1201,6 +1201,9 @@ static irqreturn_t exynos_serial_tx_chars(int irq, void *id)

spin_lock_irqsave(&port->lock, flags);

exynos_set_bit(port, S3C64XX_UINTM_TXD, S3C64XX_UINTM);
wr_regl(port, S3C64XX_UINTP, S3C64XX_UINTM_TXD_MSK);

count = CIRC_CNT_TO_END(xmit->head, xmit->tail, UART_XMIT_SIZE);

if (ourport->dma && ourport->dma->tx_chan &&
Expand Down Expand Up @@ -1265,7 +1268,9 @@ static irqreturn_t exynos_serial_tx_chars(int irq, void *id)
exynos_serial_stop_tx(port);

out:
wr_regl(port, S3C64XX_UINTP, S3C64XX_UINTM_TXD_MSK);
if (ourport->tx_enabled)
exynos_clear_bit(port, S3C64XX_UINTM_TXD, S3C64XX_UINTM);

if (ourport->uart_logging && trace_cnt)
uart_copy_to_local_buf(0, &ourport->uart_local_buf, trace_buf,
trace_cnt);
Expand Down

0 comments on commit d3a5135

Please sign in to comment.