aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaudio Scordino <claudio@evidence.eu.com>2011-12-16 15:08:49 +0100
committerGreg Kroah-Hartman <gregkh@suse.de>2012-01-12 11:29:35 -0800
commitb71bb82900b7491f47a0360f14d23dc30646433d (patch)
tree2086a35fab5ec264f5dc09f7fe2593ded58e0e71
parent7f35a6941c20af66dde1148b491e2f501192179b (diff)
downloadvexpress-lsk-b71bb82900b7491f47a0360f14d23dc30646433d.tar.gz
atmel_serial: fix spinlock lockup in RS485 code
commit dbf1115d3f8c7052788aa4e6e46abd27f3b3eeba upstream. Patch to fix a spinlock lockup in the driver that sometimes happens when the tasklet starts. Signed-off-by: Claudio Scordino <claudio@evidence.eu.com> Signed-off-by: Dave Bender <codehero@gmail.com> Tested-by: Dave Bender <codehero@gmail.com> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com> Acked-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/tty/serial/atmel_serial.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c
index 4c823f341d9..90c8e3a4922 100644
--- a/drivers/tty/serial/atmel_serial.c
+++ b/drivers/tty/serial/atmel_serial.c
@@ -212,8 +212,9 @@ void atmel_config_rs485(struct uart_port *port, struct serial_rs485 *rs485conf)
{
struct atmel_uart_port *atmel_port = to_atmel_uart_port(port);
unsigned int mode;
+ unsigned long flags;
- spin_lock(&port->lock);
+ spin_lock_irqsave(&port->lock, flags);
/* Disable interrupts */
UART_PUT_IDR(port, atmel_port->tx_done_mask);
@@ -244,7 +245,7 @@ void atmel_config_rs485(struct uart_port *port, struct serial_rs485 *rs485conf)
/* Enable interrupts */
UART_PUT_IER(port, atmel_port->tx_done_mask);
- spin_unlock(&port->lock);
+ spin_unlock_irqrestore(&port->lock, flags);
}