OSDN Git Service

serial: stm32: fix incorrect characters on console
authorErwan Le Ray <erwan.leray@foss.st.com>
Thu, 4 Mar 2021 16:22:58 +0000 (17:22 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 10 Mar 2021 08:34:10 +0000 (09:34 +0100)
commitf264c6f6aece81a9f8fbdf912b20bd3feb476a7a
treec946c89f35db0ae80eb75482df7583920d5105bc
parentf4518a8a75f5be1a121b0c95ad9c6b1eb27d920e
serial: stm32: fix incorrect characters on console

Incorrect characters are observed on console during boot. This issue occurs
when init/main.c is modifying termios settings to open /dev/console on the
rootfs.

This patch adds a waiting loop in set_termios to wait for TX shift register
empty (and TX FIFO if any) before stopping serial port.

Fixes: 48a6092fb41f ("serial: stm32-usart: Add STM32 USART Driver")
Signed-off-by: Erwan Le Ray <erwan.leray@foss.st.com>
Link: https://lore.kernel.org/r/20210304162308.8984-4-erwan.leray@foss.st.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/stm32-usart.c