OSDN Git Service

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)
commit31f6bd7fad3b149a1eb6f67fc2e742e4df369b3d
tree463107713e6683f803b96e7dcab07a1c140a6f41
parent070e246217230cce21b8dddad38bd59428494c48
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