From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: linux-serial@vger.kernel.org,
Greg KH <gregkh@linuxfoundation.org>,
Jiri Slaby <jirislaby@kernel.org>,
Douglas Anderson <dianders@chromium.org>,
Phil Edworthy <phil.edworthy@renesas.com>,
Miquel Raynal <miquel.raynal@bootlin.com>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
linux-kernel@vger.kernel.org
Cc: "Uwe Kleine-König" <u.kleine-koenig@penugtronix.de>,
"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
Subject: [PATCH v2 3/6] serial: 8250: Get preserved flags using serial_lsr_in()
Date: Mon, 6 Jun 2022 16:11:21 +0300 [thread overview]
Message-ID: <20220606131124.53394-4-ilpo.jarvinen@linux.intel.com> (raw)
In-Reply-To: <20220606131124.53394-1-ilpo.jarvinen@linux.intel.com>
serial8250_handle_irq() assumes it's the first to read LSR register.
However, there are 8250 drivers which perform LSR read in their own irq
handler prior to calling serial8250_handle_irq(). As not all flags are
preserved across LSR reads, use serial_lsr_in() helper to get all the
preserved flags.
This commit might fix other commits too besides the ones for DW UART
mentioned below. It's just not clear to me which of the other devices
clear some of the LSR flags on read. AFAIK, nobody has complained about
this problem (either against DW or other devices) so it might not have
that bad impact in the end.
Fixes: 424d79183af0 ("serial: 8250_dw: Avoid "too much work" from bogus rx timeout interrupt")
Fixes: aa63d786cea2 ("serial: 8250: dw: Add support for DMA flow controlling devices")
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
---
drivers/tty/serial/8250/8250_port.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c
index ec5abeb638eb..a0ea048eb2ad 100644
--- a/drivers/tty/serial/8250/8250_port.c
+++ b/drivers/tty/serial/8250/8250_port.c
@@ -1916,7 +1916,7 @@ int serial8250_handle_irq(struct uart_port *port, unsigned int iir)
spin_lock_irqsave(&port->lock, flags);
- status = serial_port_in(port, UART_LSR);
+ status = serial_lsr_in(up);
/*
* If port is stopped and there are no error conditions in the
--
2.30.2
next prev parent reply other threads:[~2022-06-06 13:12 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20220606131124.53394-1-ilpo.jarvinen@linux.intel.com>
2022-06-06 13:11 ` [PATCH v2 1/6] serial: 8250: Store to lsr_save_flags after lsr read Ilpo Järvinen
2022-06-06 13:41 ` Ilpo Järvinen
2022-06-06 14:09 ` Andy Shevchenko
2022-06-06 16:52 ` Ilpo Järvinen
2022-06-06 17:01 ` Andy Shevchenko
2022-06-06 19:40 ` Uwe Kleine-König
2022-06-06 20:38 ` Andy Shevchenko
2022-06-07 5:58 ` Uwe Kleine-König
2022-06-07 10:09 ` Andy Shevchenko
2022-06-07 10:32 ` Uwe Kleine-König
2022-06-07 10:54 ` Andy Shevchenko
2022-06-06 13:11 ` [PATCH v2 2/6] serial: 8250: Create serial_lsr_in() Ilpo Järvinen
2022-06-06 13:11 ` Ilpo Järvinen [this message]
2022-06-06 13:11 ` [PATCH v2 4/6] serial: 8250: Adjust misleading LSR related comment Ilpo Järvinen
2022-06-06 13:11 ` [PATCH v2 5/6] serial: 8250_dw: Use serial_lsr_in() in dw8250_handle_irq() Ilpo Järvinen
2022-06-06 13:11 ` [PATCH v2 6/6] serial: 8250_dw: Store LSR into lsr_saved_flags in dw8250_tx_wait_empty() Ilpo Järvinen
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=20220606131124.53394-4-ilpo.jarvinen@linux.intel.com \
--to=ilpo.jarvinen@linux.intel.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=dianders@chromium.org \
--cc=gregkh@linuxfoundation.org \
--cc=jirislaby@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=miquel.raynal@bootlin.com \
--cc=phil.edworthy@renesas.com \
--cc=u.kleine-koenig@penugtronix.de \
/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
all inboxes | Powered by JetHome®