diff mbox series

dma: ti: k3-udma: Reset the channel during release

Message ID 20200917144122.6199-1-vigneshr@ti.com
State Accepted
Commit 85bdcf03b79bb35b98fce26d8dd064cc1165917a
Delegated to: Lokesh Vutla
Headers show
Series dma: ti: k3-udma: Reset the channel during release | expand

Commit Message

Vignesh Raghavendra Sept. 17, 2020, 2:41 p.m. UTC
Reset the channel completely during channel release in order to clear
teardown bit before handing over to next user or jumping to Linux.

Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
---
 drivers/dma/ti/k3-udma.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Grygorii Strashko Sept. 18, 2020, 1:05 p.m. UTC | #1
On 17/09/2020 17:41, Vignesh Raghavendra wrote:
> Reset the channel completely during channel release in order to clear
> teardown bit before handing over to next user or jumping to Linux.
> 
> Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
> ---
>   drivers/dma/ti/k3-udma.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/dma/ti/k3-udma.c b/drivers/dma/ti/k3-udma.c
> index 57d9fbfabb..94216045cc 100644
> --- a/drivers/dma/ti/k3-udma.c
> +++ b/drivers/dma/ti/k3-udma.c
> @@ -1134,7 +1134,9 @@ err_free_res:
>   
>   static void udma_free_chan_resources(struct udma_chan *uc)
>   {
> -	/* Some configuration to UDMA-P channel: disable, reset, whatever */
> +	/* Hard reset UDMA channel */
> +	udma_stop_hard(uc);
> +	udma_reset_counters(uc);
>   
>   	/* Release PSI-L pairing */
>   	udma_navss_psil_unpair(uc->ud, uc->config.src_thread, uc->config.dst_thread);
> 

Thank you.
Reviewed-by: Grygorii Strashko <grygorii.strashko@ti.com>
Lokesh Vutla Oct. 12, 2020, 9:07 a.m. UTC | #2
On 17/09/20 8:11 pm, Vignesh Raghavendra wrote:
> Reset the channel completely during channel release in order to clear
> teardown bit before handing over to next user or jumping to Linux.
> 
> Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>

Applied to u-boot-ti.

Thanks and regards,
Lokesh
diff mbox series

Patch

diff --git a/drivers/dma/ti/k3-udma.c b/drivers/dma/ti/k3-udma.c
index 57d9fbfabb..94216045cc 100644
--- a/drivers/dma/ti/k3-udma.c
+++ b/drivers/dma/ti/k3-udma.c
@@ -1134,7 +1134,9 @@  err_free_res:
 
 static void udma_free_chan_resources(struct udma_chan *uc)
 {
-	/* Some configuration to UDMA-P channel: disable, reset, whatever */
+	/* Hard reset UDMA channel */
+	udma_stop_hard(uc);
+	udma_reset_counters(uc);
 
 	/* Release PSI-L pairing */
 	udma_navss_psil_unpair(uc->ud, uc->config.src_thread, uc->config.dst_thread);