From: Mike Frysinger <vapier@gentoo.org>
To: linux-serial@vger.kernel.org, Greg Kroah-Hartman <gregkh@suse.de>,
Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: uclinux-dist-devel@blackfin.uclinux.org,
Sonic Zhang <sonic.zhang@analog.com>
Subject: [PATCH 4/4] serial: bfin_5xx: grab port lock before making port termios changes
Date: Wed, 27 Oct 2010 04:16:50 -0400 [thread overview]
Message-ID: <1288167410-31554-5-git-send-email-vapier@gentoo.org> (raw)
In-Reply-To: <1288167410-31554-1-git-send-email-vapier@gentoo.org>
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>
---
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 c6774de..80f15ca 100644
--- a/drivers/serial/bfin_5xx.c
+++ b/drivers/serial/bfin_5xx.c
@@ -851,6 +851,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);
@@ -880,8 +882,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.3.2
prev parent reply other threads:[~2010-10-27 8:16 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-27 8:16 [PATCH 0/4] Blackfin UART driver updates Mike Frysinger
2010-10-27 8:16 ` [PATCH 1/4] serial: bfin_5xx: always include DMA headers Mike Frysinger
2010-10-27 8:16 ` [PATCH 2/4] serial: bfin_5xx: remove redundant SSYNC to improve TX speed Mike Frysinger
2010-10-27 8:16 ` [PATCH 3/4] serial: bfin_5xx: disable CON_PRINTBUFFER for consoles Mike Frysinger
2010-10-27 8:16 ` Mike Frysinger [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1288167410-31554-5-git-send-email-vapier@gentoo.org \
--to=vapier@gentoo.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=gregkh@suse.de \
--cc=linux-serial@vger.kernel.org \
--cc=sonic.zhang@analog.com \
--cc=uclinux-dist-devel@blackfin.uclinux.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).