From: Dan Carpenter <error27@gmail.com>
To: johan@kernel.org
Cc: linux-serial@vger.kernel.org
Subject: [bug report] serial: 8250: fix handle_irq locking
Date: Mon, 27 Feb 2023 10:16:30 +0300 [thread overview]
Message-ID: <Y/xYzqp4ogmOF5t0@kili> (raw)
Hello Johan Hovold,
The patch 853a9ae29e97: "serial: 8250: fix handle_irq locking" from
Jul 14, 2021, leads to the following Smatch static checker warning:
drivers/tty/serial/8250/8250_fsl.c:84 fsl8250_handle_irq() warn: inconsistent returns 'flags'.
Locked on : 38,46
Unlocked on: 84
drivers/tty/serial/8250/8250_fsl.c
26 int fsl8250_handle_irq(struct uart_port *port)
27 {
28 unsigned long flags;
29 u16 lsr, orig_lsr;
30 unsigned int iir;
31 struct uart_8250_port *up = up_to_u8250p(port);
32
33 spin_lock_irqsave(&up->port.lock, flags);
^^^^^
34
35 iir = port->serial_in(port, UART_IIR);
36 if (iir & UART_IIR_NO_INT) {
37 spin_unlock(&up->port.lock);
38 return 0;
Needs to enable IRQs again. Same below etc.
39 }
40
41 /* This is the WAR; if last event was BRK, then read and return */
42 if (unlikely(up->lsr_saved_flags & UART_LSR_BI)) {
43 up->lsr_saved_flags &= ~UART_LSR_BI;
44 port->serial_in(port, UART_RX);
45 spin_unlock(&up->port.lock);
46 return 1;
47 }
48
regards,
dan carpenter
next reply other threads:[~2023-02-27 7:16 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-27 7:16 Dan Carpenter [this message]
2023-02-27 8:52 ` [bug report] serial: 8250: fix handle_irq locking Johan Hovold
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=Y/xYzqp4ogmOF5t0@kili \
--to=error27@gmail.com \
--cc=johan@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox