]> git.baikalelectronics.ru Git - kernel.git/commit
serial: Store character timing information to uart_port
authorIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Mon, 25 Apr 2022 14:33:58 +0000 (17:33 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 26 Apr 2022 11:28:32 +0000 (13:28 +0200)
commitcf5023c57065f05cf9271194ca9f78eafd498602
tree463107713e6683f803b96e7dcab07a1c140a6f41
parent056b7d7a3e79eed4d268785712dca6e1b4b1fa78
serial: Store character timing information to uart_port

Struct uart_port currently stores FIFO timeout. Having character timing
information readily available is useful. Even serial core itself
determines char_time from port->timeout using inverse calculation.

Store frame_time directly into uart_port. Character time is stored in
nanoseconds to have reasonable precision with high rates. To avoid
overflow, 64-bit math is necessary.

It might be possible to determine timeout from frame_time by
multiplying it with fifosize as needed but only part of the users seem
to be protected by a lock. Thus, this patch does not pursue storing
only frame_time in uart_port.

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20220425143410.12703-2-ilpo.jarvinen@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/serial_core.c
include/linux/serial_core.h