lkml.org 
[lkml]   [2018]   [Sep]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH AUTOSEL 4.14 09/87] serial: sh-sci: Stop RX FIFO timer during port shutdown
    Date
    From: Geert Uytterhoeven <geert+renesas@glider.be>

    [ Upstream commit c5a9262fa8bfed0dddc7466ef10fcd292e2af61b ]

    The RX FIFO timer may be armed when the port is shut down, hence the
    timer function may still be called afterwards.

    Fix this race condition by deleting the timer during port shutdown.

    Fixes: 039403765e5da3c6 ("serial: sh-sci: SCIFA/B RX FIFO software timeout")
    Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
    Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    ---
    drivers/tty/serial/sh-sci.c | 2 ++
    1 file changed, 2 insertions(+)

    diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
    index 8bc8fe2b75f7..37dba940d898 100644
    --- a/drivers/tty/serial/sh-sci.c
    +++ b/drivers/tty/serial/sh-sci.c
    @@ -2060,6 +2060,8 @@ static void sci_shutdown(struct uart_port *port)
    }
    #endif

    + if (s->rx_trigger > 1 && s->rx_fifo_timeout > 0)
    + del_timer_sync(&s->rx_fifo_timer);
    sci_free_irq(s);
    sci_free_dma(port);
    }
    --
    2.17.1
    \
     
     \ /
      Last update: 2018-09-17 05:27    [W:4.071 / U:0.320 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site