Re: [PATCH v3 07/15] serial: 8250_mxpcie: speed up RX using memory-mapped FIFO window
From: Jiri Slaby
Date: Thu Jul 09 2026 - 03:16:43 EST
On 09. 07. 26, 7:33, Crescent Hsieh wrote:
...
--- a/drivers/tty/serial/8250/8250_mxpcie.c...
+++ b/drivers/tty/serial/8250/8250_mxpcie.c
@@ -266,6 +271,29 @@ static void mxpcie8250_unthrottle(struct uart_port *port)
serial_out(up, UART_IER, up->ier);
}
+static void mxpcie8250_do_rx_chars(struct uart_8250_port *up)
+{
+ struct uart_port *port = &up->port;
+ struct tty_port *tport = &port->state->port;
+ u8 buf[MOXA_PUART_FIFO_SIZE];
+ int recv_room, gdl;
+
+ recv_room = tty_buffer_request_room(tport, port->fifosize);
+ if (!recv_room)
+ return;
+
+ gdl = serial_in(up, MOXA_PUART_RX_FIFO_CNT);
+ if (gdl > recv_room)
+ gdl = recv_room;
+
+ for (int i = 0; i < gdl; ++i)
+ buf[i] = serial_in(up, MOXA_PUART_RX_FIFO_MEM + i);
This looks like tty_prepare_flip_string() is what you wanted instead.
+
+ port->icount.rx += gdl;
+ tty_insert_flip_string(tport, buf, gdl);
+ tty_flip_buffer_push(tport);
+}
+
static u16 mxpcie8250_rx_chars(struct uart_8250_port *up, u16 lsr)
{
struct uart_port *port = &up->port;
thanks,
--
js
suse labs