[PATCH 17/19] serial: bfin_5xx: grab port lock before making port termios changes

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Greg Kroah-Hartman
Date: Friday, November 12, 2010 - 2:41 pm

From: Sonic Zhang <sonic.zhang@analog.com>

The port lock exists to protect these resources, so we need to grab it
before making changes.

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/serial/bfin_5xx.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/serial/bfin_5xx.c b/drivers/serial/bfin_5xx.c
index 9655321..19cac9f 100644
--- a/drivers/serial/bfin_5xx.c
+++ b/drivers/serial/bfin_5xx.c
@@ -849,6 +849,8 @@ bfin_serial_set_termios(struct uart_port *port, struct ktermios *termios,
 	if (termios->c_cflag & CMSPAR)
 		lcr |= STP;
 
+	spin_lock_irqsave(&uart->port.lock, flags);
+
 	port->read_status_mask = OE;
 	if (termios->c_iflag & INPCK)
 		port->read_status_mask |= (FE | PE);
@@ -878,8 +880,6 @@ bfin_serial_set_termios(struct uart_port *port, struct ktermios *termios,
 	if (termios->c_line != N_IRDA)
 		quot -= ANOMALY_05000230;
 
-	spin_lock_irqsave(&uart->port.lock, flags);
-
 	UART_SET_ANOMALY_THRESHOLD(uart, USEC_PER_SEC / baud * 15);
 
 	/* Disable UART */
-- 
1.7.1

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[GIT PATCH] TTY/serial fixes for .37-rc1, Greg KH, (Fri Nov 12, 2:32 pm)
[PATCH 01/19] tty: the development tree is now done in git, Greg Kroah-Hartman, (Fri Nov 12, 2:40 pm)
[PATCH 02/19] tty: Fix formatting in tty.h, Greg Kroah-Hartman, (Fri Nov 12, 2:40 pm)
[PATCH 03/19] tty: fix warning in synclink driver, Greg Kroah-Hartman, (Fri Nov 12, 2:40 pm)
[PATCH 04/19] nozomi: Fix warning from the previous TIOCGC ..., Greg Kroah-Hartman, (Fri Nov 12, 2:40 pm)
[PATCH 05/19] 8250: add support for Kouwell KW-L221N-2, Greg Kroah-Hartman, (Fri Nov 12, 2:40 pm)
[PATCH 06/19] tty: prevent DOS in the flush_to_ldisc, Greg Kroah-Hartman, (Fri Nov 12, 2:40 pm)
[PATCH 07/19] drivers/serial/bfin_5xx.c: Fix line continua ..., Greg Kroah-Hartman, (Fri Nov 12, 2:40 pm)
[PATCH 08/19] SERIAL: blacklist si3052 chip, Greg Kroah-Hartman, (Fri Nov 12, 2:40 pm)
[PATCH 10/19] tty_ldisc: Fix BUG() on hangup, Greg Kroah-Hartman, (Fri Nov 12, 2:40 pm)
[PATCH 11/19] 8250: Fix tcsetattr to avoid ioctl(TIOCMIWAI ..., Greg Kroah-Hartman, (Fri Nov 12, 2:40 pm)
[PATCH 12/19] amiserial: Remove unused variable icount, Greg Kroah-Hartman, (Fri Nov 12, 2:40 pm)
[PATCH 13/19] vcs: make proper usage of the poll flags, Greg Kroah-Hartman, (Fri Nov 12, 2:41 pm)
[PATCH 14/19] serial: bfin_5xx: always include DMA headers, Greg Kroah-Hartman, (Fri Nov 12, 2:41 pm)
[PATCH 15/19] serial: bfin_5xx: remove redundant SSYNC to ..., Greg Kroah-Hartman, (Fri Nov 12, 2:41 pm)
[PATCH 16/19] serial: bfin_5xx: disable CON_PRINTBUFFER fo ..., Greg Kroah-Hartman, (Fri Nov 12, 2:41 pm)
[PATCH 17/19] serial: bfin_5xx: grab port lock before maki ..., Greg Kroah-Hartman, (Fri Nov 12, 2:41 pm)
[PATCH 18/19] n_gsm: Copy n2 over when configuring via ioc ..., Greg Kroah-Hartman, (Fri Nov 12, 2:41 pm)
[PATCH 19/19] n_gsm: Fix length handling, Greg Kroah-Hartman, (Fri Nov 12, 2:41 pm)
Re: [PATCH 10/19] tty_ldisc: Fix BUG() on hangup, Russ Dill, (Tue Dec 7, 2:00 pm)