From 9d0c7200c457ff330d28fa60826bcbfde3e17a17 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Thu, 13 Apr 2017 18:10:30 +0300 Subject: [PATCH] stm32: Don't perform any side effects in irq_update(). The purpose of irq_update() is to cache value of UART IRQ status register for devices which needs such caching. No other driver performs any other side effects in this call. For STM32, clearing TC (tx complete) bit was introduced in 8c079e91c90f94ece822e3be06 which is otherwise titled as a conversion to STM32Cube HAL. Thus, there does not seem to be specific reasons why this code was added. On the other hand, it leads to behaviorial artifacts when dealing with interrup-driven UART code (specific issue seen was delaying of transmitting every other character). Change-Id: Id20bf214b36eeb6c09e29cc2e6bfca4f7221a1a4 Signed-off-by: Paul Sokolovsky --- drivers/serial/uart_stm32.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/serial/uart_stm32.c b/drivers/serial/uart_stm32.c index 1846d922dabb8..d7747008d4309 100644 --- a/drivers/serial/uart_stm32.c +++ b/drivers/serial/uart_stm32.c @@ -218,11 +218,6 @@ static int uart_stm32_irq_is_pending(struct device *dev) static int uart_stm32_irq_update(struct device *dev) { - struct uart_stm32_data *data = DEV_DATA(dev); - UART_HandleTypeDef *UartHandle = &data->huart; - - __HAL_UART_CLEAR_FLAG(UartHandle, UART_FLAG_TC); - return 1; }