diff options
author | Erwan Le Ray <erwan.leray@foss.st.com> | 2021-10-25 16:42:29 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-10-26 20:18:47 +0300 |
commit | 6333a485062172e1c118b44585d90c1d835aec52 (patch) | |
tree | 28d245286a634b712d876e23c2a763693223b3e7 /tools/io_uring/liburing.h | |
parent | 6eeb348c8482862a788a2903e3fc45e76d4ea6b5 (diff) | |
download | linux-6333a485062172e1c118b44585d90c1d835aec52.tar.xz |
serial: stm32: push DMA RX data before suspending
Data may be stored in DMA RX buffer, when suspending. The data needs
to be pushed to the upper layer. We can't rely on the timeout IRQ (RTOR)
that can't be triggered into low power state. So safely clear DMA request
(DMAR), force the DMA reception routines to push RX buffer content, before
disabling RX DMA. This way, handover to pio mode is safe.
Only call tty_flip_buffer_push() when there is RX data to handle.
Move the locking outside of stm32_usart_receive_chars() to prevent a race
condition, when disabling DMA request upon suspend / pm_runtime_suspend.
Data may be received under IRQ and pushed before
stm32_usart_receive_chars() has pushed older data from DMA rx_buf upon
suspend.
The sequence in suspend routine needs proper locking to avoid this.
Signed-off-by: Fabrice Gasnier <fabrice.gasnier@foss.st.com>
Signed-off-by: Erwan Le Ray <erwan.leray@foss.st.com>
Link: https://lore.kernel.org/r/20211025134229.8456-4-erwan.leray@foss.st.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools/io_uring/liburing.h')
0 files changed, 0 insertions, 0 deletions