lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250903-master-max310x-improve-interrupt-handling-v1-1-bfb44829e760@vaisala.com>
Date: Wed, 03 Sep 2025 09:23:04 +0000
From: Tapio Reijonen <tapio.reijonen@...sala.com>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>, 
 Jiri Slaby <jirislaby@...nel.org>, Alexander Shiyan <shc_work@...l.ru>, 
 Hugo Villeneuve <hvilleneuve@...onoff.com>
Cc: linux-kernel@...r.kernel.org, linux-serial@...r.kernel.org, 
 Tapio Reijonen <tapio.reijonen@...sala.com>
Subject: [PATCH] serial: max310x: improve interrupt handling

When there is a heavy load of receiving characters to all
four UART's, the warning 'Hardware RX FIFO overrun' is
sometimes detected.
The current implementation always service first UART3 until
no more interrupt and then service another UARTs.

This commit improve interrupt service routine to handle all
interrupt sources, e.g. UARTs when a global IRQ is detected.

Signed-off-by: Tapio Reijonen <tapio.reijonen@...sala.com>
---
 drivers/tty/serial/max310x.c | 21 ++++++++++++++++-----
 1 file changed, 16 insertions(+), 5 deletions(-)

diff --git a/drivers/tty/serial/max310x.c b/drivers/tty/serial/max310x.c
index ce260e9949c3c268e706b2615d6fc01adc21e49b..3234ed7c688ff423d25a007ed8b938b249ae0b82 100644
--- a/drivers/tty/serial/max310x.c
+++ b/drivers/tty/serial/max310x.c
@@ -824,15 +824,26 @@ static irqreturn_t max310x_ist(int irq, void *dev_id)
 
 	if (s->devtype->nr > 1) {
 		do {
-			unsigned int val = ~0;
+			unsigned int val;
+			unsigned int global_irq = ~0;
+			int port;
 
 			WARN_ON_ONCE(regmap_read(s->regmap,
-						 MAX310X_GLOBALIRQ_REG, &val));
-			val = ((1 << s->devtype->nr) - 1) & ~val;
+				MAX310X_GLOBALIRQ_REG, &global_irq));
+
+			val = ((1 << s->devtype->nr) - 1) & ~global_irq;
+
 			if (!val)
 				break;
-			if (max310x_port_irq(s, fls(val) - 1) == IRQ_HANDLED)
-				handled = true;
+
+			do {
+				port = fls(val) - 1;
+				if (max310x_port_irq(s, port) == IRQ_HANDLED)
+					handled = true;
+
+				global_irq |= 1 << port;
+				val = ((1 << s->devtype->nr) - 1) & ~global_irq;
+			} while (val);
 		} while (1);
 	} else {
 		if (max310x_port_irq(s, 0) == IRQ_HANDLED)

---
base-commit: c8bc81a52d5a2ac2e4b257ae123677cf94112755
change-id: 20250903-master-max310x-improve-interrupt-handling-aa22b7ba1c1d

Best regards,
-- 
Tapio Reijonen <tapio.reijonen@...sala.com>


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ