serial: 8250: Wait for irq to complete before shutdown
authorPeter Hurley <peter@hurleysoftware.com>
Sun, 10 Jan 2016 22:39:35 +0000 (14:39 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 28 Jan 2016 22:07:04 +0000 (14:07 -0800)
After masking all interrupts, wait for the irq handler to complete
before continuing shutdown.

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/8250/8250_port.c

index 9ef77a52c4f2a08d0e1e9c59c827fee6105d44b2..57b3a80b4359a7ab2118f9490b404e8fff1c10d5 100644 (file)
@@ -2088,8 +2088,12 @@ void serial8250_do_shutdown(struct uart_port *port)
        /*
         * Disable interrupts from this port
         */
+       spin_lock_irqsave(&port->lock, flags);
        up->ier = 0;
        serial_port_out(port, UART_IER, 0);
+       spin_unlock_irqrestore(&port->lock, flags);
+
+       synchronize_irq(port->irq);
 
        if (up->dma)
                serial8250_release_dma(up);