Skip to content

Commit 27a8268

Browse files
Dan Carpentergregkh
authored andcommitted
serial: atmel: don't enable IRQs prematurely
The atmel_complete_tx_dma() function disables IRQs at the start of the function by calling spin_lock_irqsave(&port->lock, flags); There is no need to disable them a second time using the spin_lock_irq() function and, in fact, doing so is a bug because it will enable IRQs prematurely when we call spin_unlock_irq(). Just use spin_lock/unlock() instead without disabling or enabling IRQs. Fixes: 08f738b ("serial: at91: add tx dma support") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Jiri Slaby <jirislaby@kernel.org> Acked-by: Richard Genoud <richard.genoud@gmail.com> Link: https://lore.kernel.org/r/cb7c39a9-c004-4673-92e1-be4e34b85368@moroto.mountain Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 930cbf9 commit 27a8268

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/tty/serial/atmel_serial.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -868,11 +868,11 @@ static void atmel_complete_tx_dma(void *arg)
868868
dmaengine_terminate_all(chan);
869869
uart_xmit_advance(port, atmel_port->tx_len);
870870

871-
spin_lock_irq(&atmel_port->lock_tx);
871+
spin_lock(&atmel_port->lock_tx);
872872
async_tx_ack(atmel_port->desc_tx);
873873
atmel_port->cookie_tx = -EINVAL;
874874
atmel_port->desc_tx = NULL;
875-
spin_unlock_irq(&atmel_port->lock_tx);
875+
spin_unlock(&atmel_port->lock_tx);
876876

877877
if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS)
878878
uart_write_wakeup(port);

0 commit comments

Comments
 (0)