DMA Engine development
 help / color / mirror / Atom feed
* [PATCH] Revert "dmaengine: qcom: bam_dma: Avoid writing unavailable register"
@ 2025-02-08 22:30 Caleb Connolly
  2025-02-08 22:33 ` Caleb Connolly
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Caleb Connolly @ 2025-02-08 22:30 UTC (permalink / raw)
  To: Uwe Kleine-König, Amit Vadhavana, Caleb Connolly, Dave Jiang,
	Fenghua Yu, Kees Cook, Md Sadre Alam, Robin Murphy, Vinod Koul
  Cc: David Heidelberg, Dmitry Baryshkov, dmaengine, linux-arm-msm

This commit causes a hard crash on sdm845 and likely other platforms.
Revert it until a proper fix is found.

This reverts commit 57a7138d0627309d469719f1845d2778c251f358.

Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
---
 drivers/dma/qcom/bam_dma.c | 24 ++++++++----------------
 1 file changed, 8 insertions(+), 16 deletions(-)

diff --git a/drivers/dma/qcom/bam_dma.c b/drivers/dma/qcom/bam_dma.c
index c14557efd577..bbc3276992bb 100644
--- a/drivers/dma/qcom/bam_dma.c
+++ b/drivers/dma/qcom/bam_dma.c
@@ -58,11 +58,8 @@ struct bam_desc_hw {
 #define DESC_FLAG_EOB BIT(13)
 #define DESC_FLAG_NWD BIT(12)
 #define DESC_FLAG_CMD BIT(11)
 
-#define BAM_NDP_REVISION_START	0x20
-#define BAM_NDP_REVISION_END	0x27
-
 struct bam_async_desc {
 	struct virt_dma_desc vd;
 
 	u32 num_desc;
@@ -400,9 +397,8 @@ struct bam_device {
 	int irq;
 
 	/* dma start transaction tasklet */
 	struct tasklet_struct task;
-	u32 bam_revision;
 };
 
 /**
  * bam_addr - returns BAM register address
@@ -444,12 +440,10 @@ static void bam_reset(struct bam_device *bdev)
 	val |= BAM_EN;
 	writel_relaxed(val, bam_addr(bdev, 0, BAM_CTRL));
 
 	/* set descriptor threshold, start with 4 bytes */
-	if (in_range(bdev->bam_revision, BAM_NDP_REVISION_START,
-		     BAM_NDP_REVISION_END))
-		writel_relaxed(DEFAULT_CNT_THRSHLD,
-			       bam_addr(bdev, 0, BAM_DESC_CNT_TRSHLD));
+	writel_relaxed(DEFAULT_CNT_THRSHLD,
+			bam_addr(bdev, 0, BAM_DESC_CNT_TRSHLD));
 
 	/* Enable default set of h/w workarounds, ie all except BAM_FULL_PIPE */
 	writel_relaxed(BAM_CNFG_BITS_DEFAULT, bam_addr(bdev, 0, BAM_CNFG_BITS));
 
@@ -1005,12 +999,11 @@ static void bam_apply_new_config(struct bam_chan *bchan,
 		if (dir == DMA_DEV_TO_MEM)
 			maxburst = bchan->slave.src_maxburst;
 		else
 			maxburst = bchan->slave.dst_maxburst;
-		if (in_range(bdev->bam_revision, BAM_NDP_REVISION_START,
-			     BAM_NDP_REVISION_END))
-			writel_relaxed(maxburst,
-				       bam_addr(bdev, 0, BAM_DESC_CNT_TRSHLD));
+
+		writel_relaxed(maxburst,
+			       bam_addr(bdev, 0, BAM_DESC_CNT_TRSHLD));
 	}
 
 	bchan->reconfigure = 0;
 }
@@ -1198,13 +1191,12 @@ static int bam_init(struct bam_device *bdev)
 {
 	u32 val;
 
 	/* read revision and configuration information */
-	val = readl_relaxed(bam_addr(bdev, 0, BAM_REVISION));
-	if (!bdev->num_ees)
+	if (!bdev->num_ees) {
+		val = readl_relaxed(bam_addr(bdev, 0, BAM_REVISION));
 		bdev->num_ees = (val >> NUM_EES_SHIFT) & NUM_EES_MASK;
-
-	bdev->bam_revision = val & REVISION_MASK;
+	}
 
 	/* check that configured EE is within range */
 	if (bdev->ee >= bdev->num_ees)
 		return -EINVAL;
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2025-02-27 12:07 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-08 22:30 [PATCH] Revert "dmaengine: qcom: bam_dma: Avoid writing unavailable register" Caleb Connolly
2025-02-08 22:33 ` Caleb Connolly
2025-02-09  0:23 ` David Heidelberg
2025-02-09  2:03 ` Bjorn Andersson
2025-02-10 10:19   ` Vinod Koul
2025-02-10 11:40     ` neil.armstrong
2025-02-24 13:16     ` Manivannan Sadhasivam
2025-02-10 11:39 ` neil.armstrong
2025-02-27 12:07 ` Vinod Koul

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox