]> git.baikalelectronics.ru Git - kernel.git/commit
tty/serial: at91: disable uart timer at start of shutdown
authorMarek Roszko <mark.roszko@gmail.com>
Fri, 10 Jan 2014 09:33:11 +0000 (10:33 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 13 Jan 2014 23:55:59 +0000 (15:55 -0800)
commit431bb0eb6ca24e4fef092b83ddbd22a7d409bb2e
tree2fbd2b8a47104ebc014476530806b1afbbe2f2f5
parent6d74721e47e33755adf7c04507f62925e9b76801
tty/serial: at91: disable uart timer at start of shutdown

The uart timer will schedule a tasklet when it fires. It is possible that it
can fire inside _shutdown before it is killed in the dma and pdc cleanup
routines. This causes a tasklet that exists after the port is shutdown, so when
the kernel finally executes it, it panics as the tty port is NULL.

This is a somewhat rare condition but its possible if a program keeps on
opening/closing the port. It has been observed in particular with systemd
boot messages that were causing a kernel panic because of this behavior.

Moving the timer deletion to the beginning of the function stops a tasklet from
being scheduled unexpectedly.

Signed-off-by: Marek Roszko <mark.roszko@gmail.com>
Cc: stable <stable@vger.kernel.org> # v3.12
[nicolas.ferre@atmel.com: modify commit message, call setup_timer() in any case]
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/atmel_serial.c