summaryrefslogtreecommitdiffstats
path: root/drivers/tty/serial/stm32-usart.h
diff options
context:
space:
mode:
authorValentin Caron <valentin.caron@foss.st.com>2022-04-19 10:53:28 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-04-22 16:36:23 +0200
commit28fb1a92a00706d4e008ab24fbd8e4642df46ca5 (patch)
tree323c8bd551a8aa70adf5a7ecfb0a6d5a4faae4d5 /drivers/tty/serial/stm32-usart.h
parentec66b8cf03e5a63de6332c989b0ceebe4ba2937e (diff)
downloadlinux-28fb1a92a00706d4e008ab24fbd8e4642df46ca5.tar.gz
linux-28fb1a92a00706d4e008ab24fbd8e4642df46ca5.tar.bz2
linux-28fb1a92a00706d4e008ab24fbd8e4642df46ca5.zip
serial: stm32: remove infinite loop possibility in putchar function
Rework stm32_usart_console_putchar() function in order to anticipate the case where the character can never be sent. Signed-off-by: Valentin Caron <valentin.caron@foss.st.com> Link: https://lore.kernel.org/r/20220419085330.1178925-2-valentin.caron@foss.st.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/serial/stm32-usart.h')
-rw-r--r--drivers/tty/serial/stm32-usart.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/tty/serial/stm32-usart.h b/drivers/tty/serial/stm32-usart.h
index feab952aec16..d734c4a5fd24 100644
--- a/drivers/tty/serial/stm32-usart.h
+++ b/drivers/tty/serial/stm32-usart.h
@@ -251,6 +251,8 @@ struct stm32_usart_info stm32h7_info = {
#define RX_BUF_P (RX_BUF_L / 2) /* dma rx buffer period */
#define TX_BUF_L RX_BUF_L /* dma tx buffer length */
+#define STM32_USART_TIMEOUT_USEC USEC_PER_SEC /* 1s timeout in µs */
+
struct stm32_port {
struct uart_port port;
struct clk *clk;