Skip to content

Commit

Permalink
serial: mvebu-uart: free the IRQ in ->shutdown()
Browse files Browse the repository at this point in the history
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: 3053079 ("serial: mvebu-uart: initial support for Armada-3700 serial port")
Cc: <stable@vger.kernel.org>
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>
  • Loading branch information
Thomas Petazzoni authored and Greg Kroah-Hartman committed Jun 25, 2016
1 parent a593886 commit c2c1659
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/tty/serial/mvebu-uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,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,
Expand Down

0 comments on commit c2c1659

Please sign in to comment.