]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - ti-linux-kernel/ti-linux-kernel.git/commitdiff
dmaengine: ti: k3-udma: Workaround for stale transfers
authorPeter Ujfalusi <peter.ujfalusi@ti.com>
Fri, 17 Jan 2020 15:51:03 +0000 (17:51 +0200)
committerTero Kristo <t-kristo@ti.com>
Tue, 21 Jan 2020 07:44:48 +0000 (09:44 +0200)
If the client does issue_pending between terminte_all+synchronize and
free_chan_resources, we need to make sure that it has been handled and
cleared up.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Tested-by: Vignesh Raghavendra <vigneshr@ti.com>
drivers/dma/ti/k3-udma.c

index 49006008c887ccfb38d6f545cc0e06ed5702a26b..20dea3c01397a357e416c9c5bb89a6b3f0c86823 100644 (file)
@@ -2897,6 +2897,10 @@ static void udma_free_chan_resources(struct dma_chan *chan)
        struct udma_tisci_rm *tisci_rm = &ud->tisci_rm;
 
        udma_terminate_all(chan);
+       if (uc->terminated_desc) {
+               udma_reset_chan(uc, false);
+               udma_reset_rings(uc);
+       }
 
        if (uc->irq_num_ring > 0) {
                free_irq(uc->irq_num_ring, uc);