From: Inochi Amaoto <inochiama@gmail.com>
To: Karol Gugala <kgugala@antmicro.com>,
Mateusz Holenko <mholenko@antmicro.com>,
Gabriel Somlo <gsomlo@gmail.com>, Joel Stanley <joel@jms.id.au>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Jiri Slaby <jirislaby@kernel.org>
Cc: Inochi Amaoto <inochiama@gmail.com>,
linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org,
Yixun Lan <dlan@gentoo.org>, Longbin Li <looong.bin@gmail.com>
Subject: [PATCH] serial: liteuart: polling all interrupts in the IRQ process
Date: Tue, 26 Aug 2025 16:14:44 +0800 [thread overview]
Message-ID: <20250826081445.505947-1-inochiama@gmail.com> (raw)
When using liteuart with aplic and imsic, the new interrupt will lost
if the interrupt handler can not handle all the data. This is simply
because the interrupt line will never be low, and the aplic will not
send the interrupt to imsic again.
Handle all data in the IRQ handler until no data incoming.
Signed-off-by: Inochi Amaoto <inochiama@gmail.com>
---
drivers/tty/serial/liteuart.c | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/drivers/tty/serial/liteuart.c b/drivers/tty/serial/liteuart.c
index 6429e8f11f36..436e8f06fb75 100644
--- a/drivers/tty/serial/liteuart.c
+++ b/drivers/tty/serial/liteuart.c
@@ -140,11 +140,17 @@ static irqreturn_t liteuart_interrupt(int irq, void *data)
* irq[save|restore] spin_lock variants to cover all possibilities
*/
uart_port_lock_irqsave(port, &flags);
- isr = litex_read8(port->membase + OFF_EV_PENDING) & uart->irq_reg;
- if (isr & EV_RX)
- liteuart_rx_chars(port);
- if (isr & EV_TX)
- liteuart_tx_chars(port);
+
+ isr = litex_read8(port->membase + OFF_EV_PENDING);
+
+ while (isr & uart->irq_reg) {
+ if (isr & EV_RX)
+ liteuart_rx_chars(port);
+ if (isr & EV_TX)
+ liteuart_tx_chars(port);
+ isr = litex_read8(port->membase + OFF_EV_PENDING);
+ }
+
uart_port_unlock_irqrestore(port, flags);
return IRQ_RETVAL(isr);
--
2.51.0
next reply other threads:[~2025-08-26 8:15 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-26 8:14 Inochi Amaoto [this message]
2025-08-30 9:34 ` Inochi Amaoto
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=20250826081445.505947-1-inochiama@gmail.com \
--to=inochiama@gmail.com \
--cc=dlan@gentoo.org \
--cc=gregkh@linuxfoundation.org \
--cc=gsomlo@gmail.com \
--cc=jirislaby@kernel.org \
--cc=joel@jms.id.au \
--cc=kgugala@antmicro.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=looong.bin@gmail.com \
--cc=mholenko@antmicro.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
all inboxes | Powered by JetHome®