Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1415969 > unrolled thread

[PATCH v3] tty:serial:msm:Do not restore Rx interrupts in DMA

Started byCharanya Venkatraman <charanya@codeaurora.org>
First post2016-06-07 12:30 +0200
Last post2016-06-09 21:30 +0200
Articles 3 — 3 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH v3] tty:serial:msm:Do not restore Rx interrupts in DMA Charanya Venkatraman <charanya@codeaurora.org> - 2016-06-07 12:30 +0200
    Re: [PATCH v3] tty:serial:msm:Do not restore Rx interrupts in DMA Stephen Boyd <sboyd@codeaurora.org> - 2016-06-08 01:10 +0200
    Re: [PATCH v3] tty:serial:msm:Do not restore Rx interrupts in DMA Andy Gross <andy.gross@linaro.org> - 2016-06-09 21:30 +0200

#1415969 — [PATCH v3] tty:serial:msm:Do not restore Rx interrupts in DMA

FromCharanya Venkatraman <charanya@codeaurora.org>
Date2016-06-07 12:30 +0200
Subject[PATCH v3] tty:serial:msm:Do not restore Rx interrupts in DMA
Message-ID<rHmqK-1so-29@gated-at.bofh.it>
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
occurs.

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 <charanya@codeaurora.org>
---
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) {
 		port->icount.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

[toc] | [next] | [standalone]


#1416712

FromStephen Boyd <sboyd@codeaurora.org>
Date2016-06-08 01:10 +0200
Message-ID<rHyid-wP-1@gated-at.bofh.it>
In reply to#1415969
On 06/07, Charanya Venkatraman wrote:
> 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
> occurs.
> 
> 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 <charanya@codeaurora.org>
> ---

Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

[toc] | [prev] | [next] | [standalone]


#1418601

FromAndy Gross <andy.gross@linaro.org>
Date2016-06-09 21:30 +0200
Message-ID<rIdOq-2fC-15@gated-at.bofh.it>
In reply to#1415969
On Tue, Jun 07, 2016 at 03:58:41PM +0530, Charanya Venkatraman wrote:
> 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
> occurs.
> 
> 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 <charanya@codeaurora.org>

Acked-by: Andy Gross <andy.gross@linaro.org>

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web