From: robert.jarzmik@free•fr (=Robert Jarzmik)
To: linux-arm-kernel@lists•infradead.org
Subject: [PATCH] serial: pxa: hold port.lock when reporting modem line changes
Date: Mon, 24 Nov 2014 23:08:15 +0100 [thread overview]
Message-ID: <87389845gw.fsf@free.fr> (raw)
In-Reply-To: <1416815313-20891-1-git-send-email-dbaryshkov@gmail.com> (Dmitry Eremin-Solenikov's message of "Mon, 24 Nov 2014 10:48:33 +0300")
Dmitry Eremin-Solenikov <dbaryshkov@gmail•com> writes:
> diff --git a/drivers/tty/serial/pxa.c b/drivers/tty/serial/pxa.c
> index 2f4c329..b59dcb1 100644
> --- a/drivers/tty/serial/pxa.c
> +++ b/drivers/tty/serial/pxa.c
> @@ -223,6 +223,7 @@ static void serial_pxa_start_tx(struct uart_port *port)
> }
> }
>
> +/* should hold up->port.lock */
> static inline void check_modem_status(struct uart_pxa_port *up)
> {
> int status;
> @@ -258,7 +259,9 @@ static inline irqreturn_t serial_pxa_irq(int irq, void
> *dev_id)
The spin_lock() should be here I think. As the spinlock price has to be paid,
let's have the whole function under spinlock().
> lsr = serial_in(up, UART_LSR);
> if (lsr & UART_LSR_DR)
> receive_chars(up, &lsr);
> + spin_lock(&up->port.lock);
> check_modem_status(up);
> + spin_unlock(&up->port.lock);
> if (lsr & UART_LSR_THRE)
> transmit_chars(up);
The spin_unlock() should be there, after transmission IMO.
Cheers.
--
Robert
prev parent reply other threads:[~2014-11-24 22:08 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-24 7:48 [PATCH] serial: pxa: hold port.lock when reporting modem line changes Dmitry Eremin-Solenikov
2014-11-24 22:08 ` =Robert Jarzmik [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=87389845gw.fsf@free.fr \
--to=robert.jarzmik@free$(echo .)fr \
--cc=linux-arm-kernel@lists$(echo .)infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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