mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-24 05:40:55 +07:00
serial: mvebu-uart: fix calculation of clock divisor
commit 9078204ca5c33ba20443a8623a41a68a9995a70d upstream. The clock divisor should be rounded to the closest value. Signed-off-by: Pali Rohár <pali@kernel.org> Fixes:68a0db1d7d
("serial: mvebu-uart: add function to change baudrate") Cc: stable@vger.kernel.org #0e4cf69ede
("serial: mvebu-uart: clarify the baud rate derivation") Link: https://lore.kernel.org/r/20210624224909.6350-2-pali@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
8c90ec9965
commit
17451bd036
@ -463,7 +463,7 @@ static int mvebu_uart_baud_rate_set(struct uart_port *port, unsigned int baud)
|
||||
* makes use of D to configure the desired baudrate.
|
||||
*/
|
||||
m_divisor = OSAMP_DEFAULT_DIVISOR;
|
||||
d_divisor = DIV_ROUND_UP(port->uartclk, baud * m_divisor);
|
||||
d_divisor = DIV_ROUND_CLOSEST(port->uartclk, baud * m_divisor);
|
||||
|
||||
brdv = readl(port->membase + UART_BRDV);
|
||||
brdv &= ~BRDV_BAUD_MASK;
|
||||
|
Loading…
Reference in New Issue
Block a user