mbox series

[0/6] serial: stm32: improve DMA pause and resume

Message ID 20230803130134.155355-1-valentin.caron@foss.st.com
Headers show
Series serial: stm32: improve DMA pause and resume | expand

Message

Valentin Caron Aug. 3, 2023, 1:01 p.m. UTC
This series improves DMA management in stm32-usart driver.

It is not recommended to switch DMAT and DMAR bits when a DMA transfer
is in progress. This is going to be replaced by dmaengine_pause or
dmaengine_resume.

stm32_usart_rx_dma_pause, stm32_usart_rx_dma_resume, stm32_usart_tx_dma_pause
and stm32_usart_tx_dma_resume functions, are all redirected to a single function,
called "stm32_usart_dma_pause_resume", that has been created to simplify dma
pause/resume.

Amelie Delaunay (1):
  serial: stm32: synchronize RX DMA channel in shutdown

Valentin Caron (5):
  serial: stm32: avoid clearing DMAT bit during transfer
  serial: stm32: use DMAT as a configuration bit
  serial: stm32: modify parameter and rename stm32_usart_rx_dma_enabled
  serial: stm32: group dma pause/resume error handling into single
    function
  serial: stm32: replace access to DMAR bit by dmaengine_pause/resume

 drivers/tty/serial/stm32-usart.c | 307 ++++++++++++++++++-------------
 drivers/tty/serial/stm32-usart.h |   1 +
 2 files changed, 185 insertions(+), 123 deletions(-)

Comments

Greg Kroah-Hartman Aug. 4, 2023, 1:05 p.m. UTC | #1
On Thu, Aug 03, 2023 at 03:01:34PM +0200, Valentin Caron wrote:
> From: Amelie Delaunay <amelie.delaunay@foss.st.com>
> 
> In shutdown, RX DMA channel is terminated. If the DMA RX callback is
> scheduled but not yet executed, while a new RX DMA transfer is started, the
> callback can be executed, and then disturb the ongoing RX DMA transfer.
> To avoid such a case, call dmaengine_synchronize in shutdown, after the
> DMA RX channel is terminated.
> 
> Signed-off-by: Amelie Delaunay <amelie.delaunay@foss.st.com>
> ---

You can't forward on a patch from someone else and not sign-off on it
yourself :(

Please fix up and resend the series.

thanks,

greg k-h