1
0
Fork 0

serial: sh-sci: Stop RX FIFO timer during port shutdown

[ Upstream commit c5a9262fa8 ]

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: 039403765e ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
pull/10/head
Geert Uytterhoeven 2018-07-06 11:08:36 +02:00 committed by Greg Kroah-Hartman
parent 0470189cd9
commit 72bad20e93
1 changed files with 2 additions and 0 deletions

View File

@ -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);
}