[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240416182741.22514-3-mcpratt@pm.me>
Date: Tue, 16 Apr 2024 18:29:56 +0000
From: Michael Pratt <mcpratt@...me>
To: linux-kernel@...r.kernel.org, linux-serial@...r.kernel.org, Greg Kroah-Hartman <gregkh@...uxfoundation.org>, Jiri Slaby <jirislaby@...nel.org>
Cc: Wander Lairson Costa <wander@...hat.com>, Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>, Andy Shevchenko <andriy.shevchenko@...ux.intel.com>, Vamshi Gajjela <vamshigajjela@...gle.com>, Michael Pratt <mcpratt@...me>
Subject: [PATCH v2 2/3] serial: 8250: Store whether fifo device is enabled
Currently, there are 7 checks for whether to enable
the internal fifo device of a 8250/16550 type uart.
Instead of checking all 7 values again whenever
we need to know whether we have the fifo device enabled,
store the result as a struct member of uart_8250_port.
This can, for example, lessen the amount
of calculations done during a write operation.
Signed-off-by: Michael Pratt <mcpratt@...me>
---
V1 -> V2: new commit
drivers/tty/serial/8250/8250_port.c | 2 ++
include/linux/serial_8250.h | 1 +
2 files changed, 3 insertions(+)
diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c
index fc9dd5d45295..5b0cfe6bc98c 100644
--- a/drivers/tty/serial/8250/8250_port.c
+++ b/drivers/tty/serial/8250/8250_port.c
@@ -3392,6 +3392,8 @@ void serial8250_console_write(struct uart_8250_port *up, const char *s,
*/
!(up->port.flags & UPF_CONS_FLOW);
+ up->fifo_enable = use_fifo;
+
if (likely(use_fifo))
serial8250_console_fifo_write(up, s, count);
else
diff --git a/include/linux/serial_8250.h b/include/linux/serial_8250.h
index fd59ed2cca53..017429f0e743 100644
--- a/include/linux/serial_8250.h
+++ b/include/linux/serial_8250.h
@@ -127,6 +127,7 @@ struct uart_8250_port {
struct list_head list; /* ports on this IRQ */
u32 capabilities; /* port capabilities */
u16 bugs; /* port bugs */
+ unsigned int fifo_enable; /* fifo enabled if capable */
unsigned int tx_loadsz; /* transmit fifo load size */
unsigned char acr;
unsigned char fcr;
--
2.30.2
Powered by blists - more mailing lists