From: Johan Hovold <johan@kernel.org>
To: Tian Tao <tiantao6@hisilicon.com>
Cc: gregkh@linuxfoundation.org, jirislaby@kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-unisoc@lists.infradead.org, linux-serial@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] tty: serial: rad-uart: replace spin_lock_irqsave by spin_lock in hard IRQ
Date: Fri, 20 Nov 2020 09:15:25 +0100 [thread overview]
Message-ID: <X7d7HXBp01JN5It5@localhost> (raw)
In-Reply-To: <1605835613-28359-1-git-send-email-tiantao6@hisilicon.com>
On Fri, Nov 20, 2020 at 09:26:53AM +0800, Tian Tao wrote:
> The code has been in a irq-disabled context since it is hard IRQ. There
> is no necessity to do it again.
>
> Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
> ---
> drivers/tty/serial/rda-uart.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/tty/serial/rda-uart.c b/drivers/tty/serial/rda-uart.c
> index 85366e0..d6705a0 100644
> --- a/drivers/tty/serial/rda-uart.c
> +++ b/drivers/tty/serial/rda-uart.c
> @@ -406,10 +406,9 @@ static void rda_uart_receive_chars(struct uart_port *port)
> static irqreturn_t rda_interrupt(int irq, void *dev_id)
> {
> struct uart_port *port = dev_id;
> - unsigned long flags;
> u32 val, irq_mask;
>
> - spin_lock_irqsave(&port->lock, flags);
> + spin_lock(&port->lock);
This will break with forced irq threading (i.e. "threadirqs") since the
console code can still end up being called from interrupt context (which
can result in a deadlock).
>
> /* Clear IRQ cause */
> val = rda_uart_read(port, RDA_UART_IRQ_CAUSE);
> @@ -426,7 +425,7 @@ static irqreturn_t rda_interrupt(int irq, void *dev_id)
> rda_uart_send_chars(port);
> }
>
> - spin_unlock_irqrestore(&port->lock, flags);
> + spin_unlock(&port->lock);
>
> return IRQ_HANDLED;
> }
Johan
prev parent reply other threads:[~2020-11-20 8:15 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-20 1:26 [PATCH] tty: serial: rad-uart: replace spin_lock_irqsave by spin_lock in hard IRQ Tian Tao
2020-11-20 8:15 ` Johan Hovold [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=X7d7HXBp01JN5It5@localhost \
--to=johan@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=jirislaby@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=linux-unisoc@lists.infradead.org \
--cc=tiantao6@hisilicon.com \
/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).