lkml.org 
[lkml]   [2018]   [May]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4.9 93/96] serial: 8250: Dont service RX FIFO if interrupts are disabled
    Date
    4.9-stable review patch.  If anyone has any objections, please let me know.

    ------------------

    From: Vignesh R <vigneshr@ti.com>

    [ Upstream commit 2e9fe539108320820016f78ca7704a7342788380 ]

    Currently, data in RX FIFO is read based on UART_LSR register state even
    if RDI and RLSI interrupts are disabled in UART_IER register.
    This is because when IRQ handler is called due to TX FIFO empty event,
    RX FIFO is serviced based on UART_LSR register status instead of
    UART_IIR status. This defeats the purpose of disabling UART RX
    FIFO interrupts during throttling(see, omap_8250_throttle()) as IRQ
    handler continues to drain UART RX FIFO resulting in overflow of buffer
    at tty layer.
    Fix this by making sure that driver drains UART RX FIFO only when
    UART_IIR_RDI is set along with UART_LSR_BI or UART_LSR_DR bits.

    Signed-off-by: Vignesh R <vigneshr@ti.com>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    ---
    drivers/tty/serial/8250/8250_port.c | 3 ++-
    1 file changed, 2 insertions(+), 1 deletion(-)

    --- a/drivers/tty/serial/8250/8250_port.c
    +++ b/drivers/tty/serial/8250/8250_port.c
    @@ -1815,7 +1815,8 @@ int serial8250_handle_irq(struct uart_po

    status = serial_port_in(port, UART_LSR);

    - if (status & (UART_LSR_DR | UART_LSR_BI)) {
    + if (status & (UART_LSR_DR | UART_LSR_BI) &&
    + iir & UART_IIR_RDI) {
    if (!up->dma || handle_rx_dma(up, iir))
    status = serial8250_rx_chars(up, status);
    }

    \
     
     \ /
      Last update: 2018-05-24 11:54    [W:7.137 / U:0.064 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site