[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1592835984-28613-6-git-send-email-sumit.garg@linaro.org>
Date: Mon, 22 Jun 2020 19:56:22 +0530
From: Sumit Garg <sumit.garg@...aro.org>
To: kgdb-bugreport@...ts.sourceforge.net, linux-serial@...r.kernel.org
Cc: gregkh@...uxfoundation.org, daniel.thompson@...aro.org,
jason.wessel@...driver.com, dianders@...omium.org, jslaby@...e.com,
linux@...linux.org.uk, linux-kernel@...r.kernel.org,
Sumit Garg <sumit.garg@...aro.org>
Subject: [PATCH 5/7] serial: 8250: Implement poll_get_irq() interface
From: Daniel Thompson <daniel.thompson@...aro.org>
Support kgdb NMI console feature via implementing poll_get_irq()
interface. This will allow usage of RX interrupts to support kgdb entry
while serial device is operating in polling mode.
Signed-off-by: Daniel Thompson <daniel.thompson@...aro.org>
Signed-off-by: Sumit Garg <sumit.garg@...aro.org>
---
drivers/tty/serial/8250/8250_port.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c
index f77bf82..1473b1a 100644
--- a/drivers/tty/serial/8250/8250_port.c
+++ b/drivers/tty/serial/8250/8250_port.c
@@ -2138,6 +2138,21 @@ static void serial8250_put_poll_char(struct uart_port *port,
serial8250_rpm_put(up);
}
+static int serial8250_get_poll_irq(struct uart_port *port)
+{
+ unsigned int ier;
+ struct uart_8250_port *up = up_to_u8250p(port);
+
+ serial8250_rpm_get(up);
+
+ ier = serial_port_in(port, UART_IER);
+ ier |= UART_IER_RLSI | UART_IER_RDI;
+ serial_port_out(port, UART_IER, ier);
+
+ serial8250_rpm_put(up);
+ return port->irq;
+}
+
#endif /* CONFIG_CONSOLE_POLL */
int serial8250_do_startup(struct uart_port *port)
@@ -3141,6 +3156,7 @@ static const struct uart_ops serial8250_pops = {
#ifdef CONFIG_CONSOLE_POLL
.poll_get_char = serial8250_get_poll_char,
.poll_put_char = serial8250_put_poll_char,
+ .poll_get_irq = serial8250_get_poll_irq,
#endif
};
--
2.7.4
Powered by blists - more mailing lists