summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>2016-06-16 16:48:52 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-08-16 09:33:20 +0200
commit7fbb33362c693b6e991f9ff4d08cb162bae683d2 (patch)
tree0e0c14a2f87b6c2b6c6c7d91d70ae7a3cd5a90d6
parentc56d9bf4791cb9c243980dfa9a6908ee8fb7a950 (diff)
downloadlinux-stable-7fbb33362c693b6e991f9ff4d08cb162bae683d2.tar.gz
linux-stable-7fbb33362c693b6e991f9ff4d08cb162bae683d2.tar.bz2
linux-stable-7fbb33362c693b6e991f9ff4d08cb162bae683d2.zip
serial: mvebu-uart: free the IRQ in ->shutdown()
commit c2c1659b4f8f9e19fe82a4fd06cca4b3d59090ce upstream. As suggested by the serial port infrastructure documentation, the IRQ is requested in ->startup(). However, it is never freed in the ->shutdown() hook. With simple systems that open the serial port once for all and always have at least one process that keep the serial port opened, there was no problem. But with a more complicated system (*cough* systemd *cough*), the serial port is opened/closed many times, which at some point no processes having the serial port open at all. Due to this ->startup() gets called again, tries to request_irq() again, which fails. Fixes: 30530791a7a0 ("serial: mvebu-uart: initial support for Armada-3700 serial port") Cc: Ofer Heifetz <oferh@marvell.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/tty/serial/mvebu-uart.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/tty/serial/mvebu-uart.c b/drivers/tty/serial/mvebu-uart.c
index 0ff27818bb87..25b9f178c8d3 100644
--- a/drivers/tty/serial/mvebu-uart.c
+++ b/drivers/tty/serial/mvebu-uart.c
@@ -299,6 +299,8 @@ static int mvebu_uart_startup(struct uart_port *port)
static void mvebu_uart_shutdown(struct uart_port *port)
{
writel(0, port->membase + UART_CTRL);
+
+ free_irq(port->irq, port);
}
static void mvebu_uart_set_termios(struct uart_port *port,