From: =Robert Jarzmik <robert.jarzmik@free.fr>
To: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Jiri Slaby <jslaby@suse.cz>,
linux-arm-kernel@lists.infradead.org,
linux-serial@vger.kernel.org
Subject: Re: [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
WARNING: multiple messages have this Message-ID (diff)
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
next prev parent reply other threads:[~2014-11-24 22:08 UTC|newest]
Thread overview: 4+ 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 7:48 ` Dmitry Eremin-Solenikov
2014-11-24 22:08 ` =Robert Jarzmik [this message]
2014-11-24 22:08 ` =Robert Jarzmik
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.fr \
--cc=dbaryshkov@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=jslaby@suse.cz \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-serial@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.