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

* Re: [PATCH] Revert "dmaengine: qcom: bam_dma: Avoid writing unavailable register"
  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
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 9+ messages in thread
From: Caleb Connolly @ 2025-02-08 22:33 UTC (permalink / raw)
  To: Uwe Kleine-König, Amit Vadhavana, Dave Jiang, Kees Cook,
	Md Sadre Alam, Robin Murphy, Vinod Koul
  Cc: David Heidelberg, Dmitry Baryshkov, dmaengine, linux-arm-msm



On 2/8/25 22:30, Caleb Connolly wrote:
> 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>

Missing fixes tag

Fixes: 57a7138d0627 (dmaengine: qcom: bam_dma: Avoid writing unavailable 
register)
> ---
>   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;

-- 
Caleb (they/them)


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

* Re: [PATCH] Revert "dmaengine: qcom: bam_dma: Avoid writing unavailable register"
  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
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 9+ messages in thread
From: David Heidelberg @ 2025-02-09  0:23 UTC (permalink / raw)
  To: Caleb Connolly, Uwe Kleine-König, Amit Vadhavana, Dave Jiang,
	Fenghua Yu, Kees Cook, Md Sadre Alam, Robin Murphy, Vinod Koul
  Cc: Dmitry Baryshkov, dmaengine, linux-arm-msm

Fixes initial boot crash into QCOM Crashdump.

Tested-by: David Heidelberg <david@ixit.cz>

On 08/02/2025 23:30, Caleb Connolly wrote:
> 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;

-- 
David Heidelberg


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

* Re: [PATCH] Revert "dmaengine: qcom: bam_dma: Avoid writing unavailable register"
  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:39 ` neil.armstrong
  2025-02-27 12:07 ` Vinod Koul
  4 siblings, 1 reply; 9+ messages in thread
From: Bjorn Andersson @ 2025-02-09  2:03 UTC (permalink / raw)
  To: Caleb Connolly
  Cc: Uwe Kleine-König, Amit Vadhavana, Dave Jiang, Fenghua Yu,
	Kees Cook, Md Sadre Alam, Robin Murphy, Vinod Koul,
	David Heidelberg, Dmitry Baryshkov, dmaengine, linux-arm-msm

On Sat, Feb 08, 2025 at 10:30:54PM +0000, Caleb Connolly wrote:
> This commit causes a hard crash on sdm845 and likely other platforms.
> Revert it until a proper fix is found.
> 
> This reverts commit 57a7138d0627309d469719f1845d2778c251f358.
> 

I posted below patch yesterday, which reverts the change for
bdev->num_ees != 0 (i.e. SDM845), while still retaining the introduced
NDP vs Lite logic.

https://lore.kernel.org/linux-arm-msm/0892dca2-e76b-4aab-95cf-7437dabfc7a4@kernel.org/T/#t

Regards,
Bjorn

> 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	[flat|nested] 9+ messages in thread

* Re: [PATCH] Revert "dmaengine: qcom: bam_dma: Avoid writing unavailable register"
  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
  0 siblings, 2 replies; 9+ messages in thread
From: Vinod Koul @ 2025-02-10 10:19 UTC (permalink / raw)
  To: Bjorn Andersson
  Cc: Caleb Connolly, Uwe Kleine-König, Amit Vadhavana, Dave Jiang,
	Fenghua Yu, Kees Cook, Md Sadre Alam, Robin Murphy,
	David Heidelberg, Dmitry Baryshkov, dmaengine, linux-arm-msm

On 08-02-25, 20:03, Bjorn Andersson wrote:
> On Sat, Feb 08, 2025 at 10:30:54PM +0000, Caleb Connolly wrote:
> > This commit causes a hard crash on sdm845 and likely other platforms.
> > Revert it until a proper fix is found.
> > 
> > This reverts commit 57a7138d0627309d469719f1845d2778c251f358.
> > 
> 
> I posted below patch yesterday, which reverts the change for
> bdev->num_ees != 0 (i.e. SDM845), while still retaining the introduced
> NDP vs Lite logic.

Bjorn,

Given the issues reported by Stephan, do you this we should revert
and then patch it up..?

-- 
~Vinod

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

* Re: [PATCH] Revert "dmaengine: qcom: bam_dma: Avoid writing unavailable register"
  2025-02-08 22:30 [PATCH] Revert "dmaengine: qcom: bam_dma: Avoid writing unavailable register" Caleb Connolly
                   ` (2 preceding siblings ...)
  2025-02-09  2:03 ` Bjorn Andersson
@ 2025-02-10 11:39 ` neil.armstrong
  2025-02-27 12:07 ` Vinod Koul
  4 siblings, 0 replies; 9+ messages in thread
From: neil.armstrong @ 2025-02-10 11:39 UTC (permalink / raw)
  To: Caleb Connolly, Uwe Kleine-König, Amit Vadhavana, Dave Jiang,
	Fenghua Yu, Kees Cook, Md Sadre Alam, Robin Murphy, Vinod Koul
  Cc: David Heidelberg, Dmitry Baryshkov, dmaengine, linux-arm-msm

On 08/02/2025 23:30, Caleb Connolly wrote:
> 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;

This fixes the BAM DMA crash happening on DB845c & ifc6410.

Tested-by: Neil Armstrong <neil.armstrong@linaro.org> # on sdm845-DB845c
Tested-by: Neil Armstrong <neil.armstrong@linaro.org> # on apq8064-ifc6410

CI: https://git.codelinaro.org/linaro/qcomlt/ci/staging/linux/-/pipelines/131277

Thanks,
Neil

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

* Re: [PATCH] Revert "dmaengine: qcom: bam_dma: Avoid writing unavailable register"
  2025-02-10 10:19   ` Vinod Koul
@ 2025-02-10 11:40     ` neil.armstrong
  2025-02-24 13:16     ` Manivannan Sadhasivam
  1 sibling, 0 replies; 9+ messages in thread
From: neil.armstrong @ 2025-02-10 11:40 UTC (permalink / raw)
  To: Vinod Koul, Bjorn Andersson
  Cc: Caleb Connolly, Uwe Kleine-König, Amit Vadhavana, Dave Jiang,
	Fenghua Yu, Kees Cook, Md Sadre Alam, Robin Murphy,
	David Heidelberg, Dmitry Baryshkov, dmaengine, linux-arm-msm

On 10/02/2025 11:19, Vinod Koul wrote:
> On 08-02-25, 20:03, Bjorn Andersson wrote:
>> On Sat, Feb 08, 2025 at 10:30:54PM +0000, Caleb Connolly wrote:
>>> This commit causes a hard crash on sdm845 and likely other platforms.
>>> Revert it until a proper fix is found.
>>>
>>> This reverts commit 57a7138d0627309d469719f1845d2778c251f358.
>>>
>>
>> I posted below patch yesterday, which reverts the change for
>> bdev->num_ees != 0 (i.e. SDM845), while still retaining the introduced
>> NDP vs Lite logic.
> 
> Bjorn,
> 
> Given the issues reported by Stephan, do you this we should revert
> and then patch it up..?
> 

With Bjorn's change, DB845c is fixed, but ifc6410 is still broken:

https://git.codelinaro.org/linaro/qcomlt/ci/staging/cdba-tester/-/pipelines/131282

So please revert to it can be resubmitted correctly

Neil

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

* Re: [PATCH] Revert "dmaengine: qcom: bam_dma: Avoid writing unavailable register"
  2025-02-10 10:19   ` Vinod Koul
  2025-02-10 11:40     ` neil.armstrong
@ 2025-02-24 13:16     ` Manivannan Sadhasivam
  1 sibling, 0 replies; 9+ messages in thread
From: Manivannan Sadhasivam @ 2025-02-24 13:16 UTC (permalink / raw)
  To: Vinod Koul
  Cc: Bjorn Andersson, Caleb Connolly, Uwe Kleine-König,
	Amit Vadhavana, Dave Jiang, Fenghua Yu, Kees Cook, Md Sadre Alam,
	Robin Murphy, David Heidelberg, Dmitry Baryshkov, dmaengine,
	linux-arm-msm

On Mon, Feb 10, 2025 at 03:49:52PM +0530, Vinod Koul wrote:
> On 08-02-25, 20:03, Bjorn Andersson wrote:
> > On Sat, Feb 08, 2025 at 10:30:54PM +0000, Caleb Connolly wrote:
> > > This commit causes a hard crash on sdm845 and likely other platforms.
> > > Revert it until a proper fix is found.
> > > 
> > > This reverts commit 57a7138d0627309d469719f1845d2778c251f358.
> > > 
> > 
> > I posted below patch yesterday, which reverts the change for
> > bdev->num_ees != 0 (i.e. SDM845), while still retaining the introduced
> > NDP vs Lite logic.
> 
> Bjorn,
> 
> Given the issues reported by Stephan, do you this we should revert
> and then patch it up..?
> 

Vinod, please apply this revert patch as there doesn't seem to be a proper fix.
The offending commit causes hang in multiple platforms.

- Mani

-- 
மணிவண்ணன் சதாசிவம்

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

* Re: [PATCH] Revert "dmaengine: qcom: bam_dma: Avoid writing unavailable register"
  2025-02-08 22:30 [PATCH] Revert "dmaengine: qcom: bam_dma: Avoid writing unavailable register" Caleb Connolly
                   ` (3 preceding siblings ...)
  2025-02-10 11:39 ` neil.armstrong
@ 2025-02-27 12:07 ` Vinod Koul
  4 siblings, 0 replies; 9+ messages in thread
From: Vinod Koul @ 2025-02-27 12:07 UTC (permalink / raw)
  To: Uwe Kleine-König, Amit Vadhavana, Dave Jiang, Fenghua Yu,
	Kees Cook, Md Sadre Alam, Robin Murphy, Caleb Connolly
  Cc: David Heidelberg, Dmitry Baryshkov, dmaengine, linux-arm-msm


On Sat, 08 Feb 2025 22:30:54 +0000, Caleb Connolly wrote:
> This commit causes a hard crash on sdm845 and likely other platforms.
> Revert it until a proper fix is found.
> 
> This reverts commit 57a7138d0627309d469719f1845d2778c251f358.
> 
> 

Applied, thanks!

[1/1] Revert "dmaengine: qcom: bam_dma: Avoid writing unavailable register"
      commit: e521f516716de7895acd1b5b7fac788214a390b9

Best regards,
-- 
~Vinod



^ permalink raw reply	[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