]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - rpmsg/rpmsg.git/commitdiff
dmaengine: ti: k3-udma: Do a complete reset of the channel to recover
authorPeter Ujfalusi <peter.ujfalusi@ti.com>
Fri, 5 Oct 2018 17:54:57 +0000 (17:54 +0000)
committerTero Kristo <t-kristo@ti.com>
Tue, 16 Oct 2018 08:55:09 +0000 (11:55 +0300)
PSI-L unpair and pair will toggle the ENABLE of the UDMA and peer, but after
this the channel needs to be reconfigured.

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

index 07de58c1b55890ff94a875a6504a6d362eadc1b2..2cf8ff59a456e3e070672f300a4ac61d35be0e0d 100644 (file)
@@ -810,17 +810,14 @@ static inline int udma_reset_chan(struct udma_chan *uc, bool hard)
        /* Reset all counters */
        udma_reset_counters(uc);
 
+       /* Hard reset: re-initialize the channel to reset */
        if (hard) {
-               k3_nav_psil_release_link(uc->psi_link);
-               uc->psi_link = k3_nav_psil_request_link(uc->ud->psil_node,
-                                                       uc->src_thread,
-                                                       uc->dst_thread);
-               if (IS_ERR(uc->psi_link)) {
-                       dev_err(uc->ud->dev,
-                               "Hard reset failed, chan%d can not be used.\n",
-                               uc->id);
-                       uc->psi_link = NULL;
-               }
+               int ret;
+
+               uc->ud->ddev.device_free_chan_resources(&uc->vc.chan);
+               ret = uc->ud->ddev.device_alloc_chan_resources(&uc->vc.chan);
+               if (ret)
+                       return ret;
        }
        uc->state = UDMA_CHAN_IS_IDLE;