Skip to content

Commit 2a3bcfe

Browse files
VCASTMgregkh
authored andcommitted
serial: stm32: fix flow control transfer in DMA mode
If flow control is enabled, framework will call stop_tx to pause transfer and then call start_tx to resume transfer. Clear USART_CR3_DMAT bit in stop_tx ops to pause DMA transfer. Signed-off-by: Erwan Le Ray <[email protected]> Signed-off-by: Valentin Caron <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 9a135f1 commit 2a3bcfe

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/tty/serial/stm32-usart.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -707,8 +707,11 @@ static void stm32_usart_stop_tx(struct uart_port *port)
707707
{
708708
struct stm32_port *stm32_port = to_stm32_port(port);
709709
struct serial_rs485 *rs485conf = &port->rs485;
710+
const struct stm32_usart_offsets *ofs = &stm32_port->info->ofs;
710711

711712
stm32_usart_tx_interrupt_disable(port);
713+
if (stm32_usart_tx_dma_started(stm32_port) && stm32_usart_tx_dma_enabled(stm32_port))
714+
stm32_usart_clr_bits(port, ofs->cr3, USART_CR3_DMAT);
712715

713716
if (rs485conf->flags & SER_RS485_ENABLED) {
714717
if (rs485conf->flags & SER_RS485_RTS_ON_SEND) {

0 commit comments

Comments
 (0)