Skip to contentSkip to conversation

dma: ti: k3-udma: Do not touch RT registers before channel configuration

PATCH New Vignesh Raghavendra 4 participants 4 messages Apr 25, 2019 – May 3, 2019

Subsystems (2)
lore
Share & tools
lore

Vignesh Raghavendra

author maintainer
#0 lore raw

PATCH 1/1 dma: ti: k3-udma: Do not touch RT registers before channel configuration

From: Peter Ujfalusi <[email protected]>

Upcoming sysfw (2019.03) will not open the channelized firewalls during init, it only going to do so in response to the channel configuration message.

Remove the channel state checks done before the channel configuration and move it after the configuration for warning purposes.

---
 drivers/dma/ti/k3-udma.c | 33 +++++++++------------------------
 1 file changed, 9 insertions(+), 24 deletions(-)
drivers/dma/ti/k3-udma.c +9 -24
index f78a01aa8f8c..f896e2958755 100644
@@ -575,14 +575,6 @@ static int udma_get_tchan(struct udma_chan *uc)
 
 	pr_debug("chan%d: got tchan%d\n", uc->id, uc->tchan->id);
 
-	if (udma_is_chan_running(uc)) {
-		dev_warn(ud->dev, "chan%d: tchan%d is running!\n", uc->id,
-			 uc->tchan->id);
-		udma_stop(uc);
-		if (udma_is_chan_running(uc))
-			dev_err(ud->dev, "chan%d: won't stop!\n", uc->id);
-	}
-
 	return 0;
 }
 
@@ -602,14 +594,6 @@ static int udma_get_rchan(struct udma_chan *uc)
 
 	pr_debug("chan%d: got rchan%d\n", uc->id, uc->rchan->id);
 
-	if (udma_is_chan_running(uc)) {
-		dev_warn(ud->dev, "chan%d: rchan%d is running!\n", uc->id,
-			 uc->rchan->id);
-		udma_stop(uc);
-		if (udma_is_chan_running(uc))
-			dev_err(ud->dev, "chan%d: won't stop!\n", uc->id);
-	}
-
 	return 0;
 }
 
@@ -652,14 +636,6 @@ static int udma_get_chan_pair(struct udma_chan *uc)
 
 	pr_debug("chan%d: got t/rchan%d pair\n", uc->id, chan_id);
 
-	if (udma_is_chan_running(uc)) {
-		dev_warn(ud->dev, "chan%d: t/rchan%d pair is running!\n",
-			 uc->id, chan_id);
-		udma_stop(uc);
-		if (udma_is_chan_running(uc))
-			dev_err(ud->dev, "chan%d: won't stop!\n", uc->id);
-	}
-
 	return 0;
 }
 
@@ -1071,6 +1047,15 @@ static int udma_alloc_chan_resources(struct udma_chan *uc)
 		}
 	}
 
+	if (udma_is_chan_running(uc)) {
+		dev_warn(ud->dev, "chan%d: is running!\n", uc->id);
+		udma_stop(uc);
+		if (udma_is_chan_running(uc)) {
+			dev_err(ud->dev, "chan%d: won't stop!\n", uc->id);
+			goto err_free_res;
+		}
+	}
+
 	/* PSI-L pairing */
 	ret = udma_navss_psil_pair(ud, uc->src_thread, uc->dst_thread);
 	if (ret) {
Signature · 1 line
2.21.0
#1 lore raw

PATCH 1/1 dma: ti: k3-udma: Do not touch RT registers before channel configuration

Quoted 6 lines · Vignesh Raghavendra

From: Peter Ujfalusi <[email protected]>

Upcoming sysfw (2019.03) will not open the channelized firewalls during init, it only going to do so in response to the channel configuration message.

Quoted 8 lines

Remove the channel state checks done before the channel configuration and move it after the configuration for warning purposes.

---
 drivers/dma/ti/k3-udma.c | 33 +++++++++------------------------
 1 file changed, 9 insertions(+), 24 deletions(-)
Signature · 2 lines
Best regards,
grygorii
#2 lore raw

PATCH 1/1 dma: ti: k3-udma: Do not touch RT registers before channel configuration

Quoted 12 lines · Grygorii Strashko
Quoted 9 lines · Vignesh Raghavendra

From: Peter Ujfalusi <[email protected]>

Upcoming sysfw (2019.03) will not open the channelized firewalls during init, it only going to do so in response to the channel configuration message.

Remove the channel state checks done before the channel configuration and move it after the configuration for warning purposes.

Quoted 7 lines
Quoted 5 lines
---
  drivers/dma/ti/k3-udma.c | 33 +++++++++------------------------
  1 file changed, 9 insertions(+), 24 deletions(-)

Tom,

This is needed for cpsw to work am65. Please pull this patch.

Thanks,
Keerthy

Quoted 1 line
#3 lore raw

PATCH 1/1 dma: ti: k3-udma: Do not touch RT registers before channel configuration

In reply to Vignesh Raghavendra
Quoted 6 lines · Vignesh Raghavendra

From: Peter Ujfalusi <[email protected]>

Upcoming sysfw (2019.03) will not open the channelized firewalls during init, it only going to do so in response to the channel configuration message.

Quoted 6 lines

Remove the channel state checks done before the channel configuration and move it after the configuration for warning purposes.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190503/2c578690/attachment.sig>