Skip to contentSkip to conversation

dma: ti: k3-udma: Fix channel hang on teardown

PATCH In review Vignesh Raghavendra 2 participants 2 messages Mar 8, 2023 – Mar 22, 2023

Subsystems (2)
lore
Share & tools
lore

Vignesh Raghavendra

author maintainer
#0 lore raw

PATCH 1/1 dma: ti: k3-udma: Fix channel hang on teardown

Setting RX flow error handling will stall the channel until descriptors are available to move RX data. Setting this bit causes issues when tearing down ethernet DMA channel at the end of TFTP transfer as unrelated network packets can cause teardown to stall indefinitely waiting for driver to queue add more desc leading to channel hang with error logs:
udma_stop_dev2mem TIMEOUT !
udma_stop_dev2mem: peer not stopped TIMEOUT ! udma_stop_dev2mem TIMEOUT !

Fix this by clearing rx_error_handling similar to how its done for UDMA as part of udma_alloc_rchan_sci_req()

This fixes occasional TFTP Failures seen when downloading multiple files one after the other on AM64/AM62 SoCs.

Fixes 9a92851c33e8 ("dma: ti: k3-udma: Add BCDMA and PKTDMA support")
---
 drivers/dma/ti/k3-udma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/dma/ti/k3-udma.c +1 -1
index d92b96443694..05c3a4311ced 100644
@@ -2150,7 +2150,7 @@ static int pktdma_tisci_rx_channel_config(struct udma_chan *uc)
 		flow_req.rx_psinfo_present = 1;
 	else
 		flow_req.rx_psinfo_present = 0;
-	flow_req.rx_error_handling = 1;
+	flow_req.rx_error_handling = 0;
 
 	ret = tisci_ops->rx_flow_cfg(tisci_rm->tisci, &flow_req);
 
Signature · 1 line
2.39.2
#1 lore raw
Quoted 13 lines · Vignesh Raghavendra

Setting RX flow error handling will stall the channel until descriptors are available to move RX data. Setting this bit causes issues when tearing down ethernet DMA channel at the end of TFTP transfer as unrelated network packets can cause teardown to stall indefinitely waiting for driver to queue add more desc leading to channel hang with error logs:
udma_stop_dev2mem TIMEOUT !
udma_stop_dev2mem: peer not stopped TIMEOUT ! udma_stop_dev2mem TIMEOUT !

Fix this by clearing rx_error_handling similar to how its done for UDMA as part of udma_alloc_rchan_sci_req()

Quoted 6 lines

This fixes occasional TFTP Failures seen when downloading multiple files one after the other on AM64/AM62 SoCs.

Fixes 9a92851c33e8 ("dma: ti: k3-udma: Add BCDMA and PKTDMA support")

Applied to u-boot/master, thanks!

Signature · 1 line
Tom