Skip to content

Commit

Permalink
serial: bfin_5xx: grab port lock before making port termios changes
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Sonic Zhang authored and Greg Kroah-Hartman committed Nov 11, 2010
1 parent 6d9e449 commit 5bb06b6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/serial/bfin_5xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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 */
Expand Down

0 comments on commit 5bb06b6

Please sign in to comment.