From: Huibin Hong Date: Mon, 24 Oct 2016 11:34:59 +0000 (+0800) Subject: serial: 8250: Disable UART_IER_RLSI and UART_IER_RDI for dma receive X-Git-Tag: firefly_0821_release~1363 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=5cc2ffa56f2b0a3e08ceac8f529fd3941c28d125;p=firefly-linux-kernel-4.4.55.git serial: 8250: Disable UART_IER_RLSI and UART_IER_RDI for dma receive For rockchip serial, received data available and character timeout interrupts are both enabled by IER[0]. Then when there is data in the FIFO, received data available interrupt will occurd frequently. So we must disable it, but which may disable the character timeout interrput. Then it is useful to add a timer to report the data received in dma buffer every 10 microsecond. Change-Id: I1cf9dee495453d3530ab66c95a4e4cfef46b7795 Signed-off-by: Huibin Hong --- diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c index 56ccbcefdd85..4feb9ed92d7c 100644 --- a/drivers/tty/serial/8250/8250_port.c +++ b/drivers/tty/serial/8250/8250_port.c @@ -1563,9 +1563,17 @@ int serial8250_handle_irq(struct uart_port *port, unsigned int iir) DEBUG_INTR("status = %x...", status); if (status & (UART_LSR_DR | UART_LSR_BI)) { - if (up->dma) - dma_err = up->dma->rx_dma(up, iir); + if (up->dma) { + /* + * The RDI must be masked, or interrupt + * would occur all the time. + */ + up->ier &= ~(UART_IER_RLSI | UART_IER_RDI); + up->port.read_status_mask &= ~UART_LSR_DR; + serial_port_out(port, UART_IER, up->ier); + dma_err = up->dma->rx_dma(up, iir); + } if (!up->dma || dma_err) status = serial8250_rx_chars(up, status); } @@ -2355,6 +2363,9 @@ serial8250_do_set_termios(struct uart_port *port, struct ktermios *termios, serial8250_set_divisor(port, baud, quot, frac); + if (up->dma) + up->fcr = UART_FCR_ENABLE_FIFO | UART_FCR_T_TRIG_11; + /* * LCR DLAB must be set to enable 64-byte FIFO mode. If the FCR * is written without DLAB set, this mode will be disabled.