Linux-ARM-MSM Archive on
 help / color / Atom feed
From: Charanya Venkatraman <>
	Charanya Venkatraman <>
Subject: [PATCH v3] tty:serial:msm:Do not restore Rx interrupts in DMA
Date: Tue,  7 Jun 2016 15:58:41 +0530
Message-ID: <> (raw)
In-Reply-To: <1462896580-11554-1>

Avoid data corruption issues that result in CRC errors during file
transfers over serial ports at higher baud rates.

The current msm_serial driver masks the FIFO Rx interrupts in
msm_start_rx_dma() since Rx FIFO interrupts are not required in DMA
mode. However, msm_complete_rx_dma() re-enables the Rx FIFO interrupts
which could cause RXSTALE event to be processed when a TXLEV interrupt

The following is the sequence of events that could occur resulting in
data corruption.

msm_start_rx_dma -> msm_complete_rx_dma -->
spin_unlock_irqrestore(&port->lock) -->
msm_uart_irq()(For TXLEV interrupt) -->  msm_handle_rx_dm() (Read from
FIFO resulting in data corruption)

The patch fixes the issue by not restoring the RXLEV and RXSTALE
interrupts in msm_complete_rx_dma(). These interrupts are required only
in FIFO mode.

Signed-off-by: Charanya Venkatraman <>
Changes in v2:
	- Make commit message more clearer.
Changes in v3:
	- Fix typos in commit message.

 drivers/tty/serial/msm_serial.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/tty/serial/msm_serial.c b/drivers/tty/serial/msm_serial.c
index b7d80bd..646aa3f 100644
--- a/drivers/tty/serial/msm_serial.c
+++ b/drivers/tty/serial/msm_serial.c
@@ -388,10 +388,6 @@ static void msm_complete_rx_dma(void *args)
 	val &= ~dma->enable_bit;
 	msm_write(port, val, UARTDM_DMEN);
-	/* Restore interrupts */
-	msm_port->imr |= UART_IMR_RXLEV | UART_IMR_RXSTALE;
-	msm_write(port, msm_port->imr, UART_IMR);
 	if (msm_read(port, UART_SR) & UART_SR_OVERRUN) {
 		tty_insert_flip_char(tport, 0, TTY_OVERRUN);
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

  parent reply index

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1462896580-11554-1>
2016-06-03 11:10 ` [PATCH v2] " Charanya Venkatraman
2016-06-03 15:47   ` Greg KH
2016-06-07 10:28 ` Charanya Venkatraman [this message]
2016-06-07 23:08   ` [PATCH v3] " Stephen Boyd
2016-06-09 19:27   ` Andy Gross

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-ARM-MSM Archive on

Archives are clonable:
	git clone --mirror linux-arm-msm/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-arm-msm linux-arm-msm/ \
	public-inbox-index linux-arm-msm

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone