Pali Rohár 32262e2e42 serial: 8250: Fix reporting real baudrate value in c_ospeed field
In most cases it is not possible to set exact baudrate value to hardware.

So fix reporting real baudrate value which was set to hardware via c_ospeed
termios field. It can be retrieved by ioctl(TCGETS2) from userspace.

Real baudrate value is calculated from chosen hardware divisor and base
clock. It is implemented in a new function serial8250_compute_baud_rate()
which is inverse of serial8250_get_divisor() function.

With this change is fixed also UART timeout value (it is updated via
uart_update_timeout() function), which is calculated from the now fixed
baudrate value too.

Cc: stable@vger.kernel.org
Signed-off-by: Pali Rohár <pali@kernel.org>
Link: https://lore.kernel.org/r/20210927093704.19768-1-pali@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-05 15:02:58 +02:00
..
2021-09-01 08:44:42 -07:00
2021-09-11 14:48:42 -07:00
2021-09-01 15:25:28 -07:00
2021-09-07 12:38:59 -07:00
2021-09-07 19:13:42 -07:00
2021-09-09 11:48:27 -07:00
2021-09-09 11:39:57 -07:00
2021-09-08 11:50:26 -07:00
2021-09-09 11:07:47 -07:00
2021-09-24 10:14:19 -07:00
2021-09-15 17:18:56 -07:00
2021-09-02 13:49:39 -07:00
2021-09-11 14:48:42 -07:00
2021-09-01 09:51:16 -07:00
2021-09-03 15:33:47 -07:00
2021-09-01 08:44:42 -07:00
2021-09-07 12:38:59 -07:00
2021-09-27 16:36:09 +02:00
2021-09-09 11:48:27 -07:00
2021-09-21 09:17:15 +02:00
2021-09-25 15:37:31 -07:00
2021-09-03 15:33:47 -07:00
2021-09-20 11:11:54 +01:00
2021-09-01 15:25:28 -07:00
2021-09-23 10:30:31 -07:00
2021-09-01 08:44:42 -07:00
2021-09-01 15:25:28 -07:00
2021-09-01 10:29:29 -07:00
2021-09-22 11:58:24 -07:00
2021-09-24 10:22:53 +02:00
2021-09-11 14:48:42 -07:00
2021-09-02 13:41:33 -07:00
2021-09-18 11:15:01 -07:00
2021-09-11 14:48:42 -07:00
2021-09-25 15:37:31 -07:00