Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5bb06b62 authored by Sonic Zhang's avatar Sonic Zhang Committed by Greg Kroah-Hartman
Browse files

serial: bfin_5xx: grab port lock before making port termios changes



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

Signed-off-by: default avatarSonic Zhang <sonic.zhang@analog.com>
Signed-off-by: default avatarMike Frysinger <vapier@gentoo.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 6d9e4498
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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 */