]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
tty/serial: atmel: fix out of range clock divider handling
authorDavid Engraf <david.engraf@sysgo.com>
Mon, 16 Dec 2019 08:54:03 +0000 (09:54 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 4 Jan 2020 12:41:09 +0000 (13:41 +0100)
commitedad0c235efe323a8faa7317fe72bd6850b3f125
tree631c6ea1bdc73ef891cf32dea516a7fb5ca446dc
parent190d14f3ddc66f1cfe7f48e83f91d2e3a8b12372
tty/serial: atmel: fix out of range clock divider handling

[ Upstream commit cb47b9f8630ae3fa3f5fbd0c7003faba7abdf711 ]

Use MCK_DIV8 when the clock divider is > 65535. Unfortunately the mode
register was already written thus the clock selection is ignored.

Fix by doing the baud rate calulation before setting the mode.

Fixes: 5bf5635ac170 ("tty/serial: atmel: add fractional baud rate support")
Signed-off-by: David Engraf <david.engraf@sysgo.com>
Acked-by: Ludovic Desroches <ludovic.desroches@microchip.com>
Acked-by: Richard Genoud <richard.genoud@gmail.com>
Cc: stable <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20191216085403.17050-1-david.engraf@sysgo.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/tty/serial/atmel_serial.c