]> git.baikalelectronics.ru Git - kernel.git/commit
serial: mvebu-uart: correctly report configured baudrate value
authorPali Rohár <pali@kernel.org>
Tue, 28 Jun 2022 10:09:22 +0000 (12:09 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 29 Jul 2022 15:14:09 +0000 (17:14 +0200)
commit911d4a9d6fd5d02e59ba27296243c89d1400be2d
tree6c6a43eede2de3f4824bf581cf3e3cae55dec62f
parent2b2618d3eb524cf3d1ba225ad1d4f952cd7a716f
serial: mvebu-uart: correctly report configured baudrate value

commit f3199f0a79d4a9507986f5022c64939a45258d78 upstream.

Functions tty_termios_encode_baud_rate() and uart_update_timeout() should
be called with the baudrate value which was set to hardware. Linux then
report exact values via ioctl(TCGETS2) to userspace.

Change mvebu_uart_baud_rate_set() function to return baudrate value which
was set to hardware and propagate this value to above mentioned functions.

With this change userspace would see precise value in termios c_ospeed
field.

Fixes: db4ef1010c48 ("serial: mvebu-uart: add function to change baudrate")
Cc: stable <stable@kernel.org>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Pali Rohár <pali@kernel.org>
Link: https://lore.kernel.org/r/20220628100922.10717-1-pali@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/mvebu-uart.c