[v2,2/2] dmaengine: fsl-edma: Add judgment on enabling round robin arbitration

Message ID 20231113225713.1892643-3-xiaolei.wang@windriver.com
State New
Headers
Series Fix two exceptions after the introduction of edma v3 |

Commit Message

xiaolei wang Nov. 13, 2023, 10:57 p.m. UTC
  Add judgment on enabling round robin arbitration to avoid
exceptions if this function is not supported.

Call trace:
 fsl_edma_resume_early+0x1d4/0x208
 dpm_run_callback+0xd4/0x304
 device_resume_early+0xb0/0x208
 dpm_resume_early+0x224/0x528
 suspend_devices_and_enter+0x3e4/0xd00
 pm_suspend+0x3c4/0x910
 state_store+0x90/0x124
 kobj_attr_store+0x48/0x64
 sysfs_kf_write+0x84/0xb4
 kernfs_fop_write_iter+0x19c/0x264
 vfs_write+0x664/0x858
 ksys_write+0xc8/0x180
 __arm64_sys_write+0x44/0x58
 invoke_syscall+0x5c/0x178
 el0_svc_common.constprop.0+0x11c/0x14c
 do_el0_svc+0x30/0x40
 el0_svc+0x58/0xa8
 el0t_64_sync_handler+0xc0/0xc4
 el0t_64_sync+0x190/0x194

Fixes: 72f5801a4e2b ("dmaengine: fsl-edma: integrate v3 support")
Signed-off-by: Xiaolei Wang <xiaolei.wang@windriver.com>
---
 drivers/dma/fsl-edma-main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
  

Comments

Frank Li Nov. 14, 2023, 3:09 p.m. UTC | #1
On Tue, Nov 14, 2023 at 06:57:13AM +0800, Xiaolei Wang wrote:
> Add judgment on enabling round robin arbitration to avoid
> exceptions if this function is not supported.
> 
> Call trace:
>  fsl_edma_resume_early+0x1d4/0x208
>  dpm_run_callback+0xd4/0x304
>  device_resume_early+0xb0/0x208
>  dpm_resume_early+0x224/0x528
>  suspend_devices_and_enter+0x3e4/0xd00
>  pm_suspend+0x3c4/0x910
>  state_store+0x90/0x124
>  kobj_attr_store+0x48/0x64
>  sysfs_kf_write+0x84/0xb4
>  kernfs_fop_write_iter+0x19c/0x264
>  vfs_write+0x664/0x858
>  ksys_write+0xc8/0x180
>  __arm64_sys_write+0x44/0x58
>  invoke_syscall+0x5c/0x178
>  el0_svc_common.constprop.0+0x11c/0x14c
>  do_el0_svc+0x30/0x40
>  el0_svc+0x58/0xa8
>  el0t_64_sync_handler+0xc0/0xc4
>  el0t_64_sync+0x190/0x194
> 
> Fixes: 72f5801a4e2b ("dmaengine: fsl-edma: integrate v3 support")
> Signed-off-by: Xiaolei Wang <xiaolei.wang@windriver.com>
> ---

Reviewed-by: Frank Li <Frank.Li@nxp.com>

>  drivers/dma/fsl-edma-main.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/dma/fsl-edma-main.c b/drivers/dma/fsl-edma-main.c
> index 52577fffc62b..aea7a703dda7 100644
> --- a/drivers/dma/fsl-edma-main.c
> +++ b/drivers/dma/fsl-edma-main.c
> @@ -665,7 +665,8 @@ static int fsl_edma_resume_early(struct device *dev)
>  			fsl_edma_chan_mux(fsl_chan, fsl_chan->slave_id, true);
>  	}
>  
> -	edma_writel(fsl_edma, EDMA_CR_ERGA | EDMA_CR_ERCA, regs->cr);
> +	if (!(fsl_edma->drvdata->flags & FSL_EDMA_DRV_SPLIT_REG))
> +		edma_writel(fsl_edma, EDMA_CR_ERGA | EDMA_CR_ERCA, regs->cr);
>  
>  	return 0;
>  }
> -- 
> 2.25.1
>
  
Frank Li Nov. 14, 2023, 3:11 p.m. UTC | #2
On Tue, Nov 14, 2023 at 06:57:13AM +0800, Xiaolei Wang wrote:
> Add judgment on enabling round robin arbitration to avoid
> exceptions if this function is not supported.
> 
> Call trace:
>  fsl_edma_resume_early+0x1d4/0x208
>  dpm_run_callback+0xd4/0x304
>  device_resume_early+0xb0/0x208
>  dpm_resume_early+0x224/0x528
>  suspend_devices_and_enter+0x3e4/0xd00
>  pm_suspend+0x3c4/0x910
>  state_store+0x90/0x124
>  kobj_attr_store+0x48/0x64
>  sysfs_kf_write+0x84/0xb4
>  kernfs_fop_write_iter+0x19c/0x264
>  vfs_write+0x664/0x858
>  ksys_write+0xc8/0x180
>  __arm64_sys_write+0x44/0x58
>  invoke_syscall+0x5c/0x178
>  el0_svc_common.constprop.0+0x11c/0x14c
>  do_el0_svc+0x30/0x40
>  el0_svc+0x58/0xa8
>  el0t_64_sync_handler+0xc0/0xc4
>  el0t_64_sync+0x190/0x194
> 
> Fixes: 72f5801a4e2b ("dmaengine: fsl-edma: integrate v3 support")
> Signed-off-by: Xiaolei Wang <xiaolei.wang@windriver.com>
> ---

Reviewed-by: Frank Li <Frank.Li@nxp.com>

>  drivers/dma/fsl-edma-main.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/dma/fsl-edma-main.c b/drivers/dma/fsl-edma-main.c
> index 52577fffc62b..aea7a703dda7 100644
> --- a/drivers/dma/fsl-edma-main.c
> +++ b/drivers/dma/fsl-edma-main.c
> @@ -665,7 +665,8 @@ static int fsl_edma_resume_early(struct device *dev)
>  			fsl_edma_chan_mux(fsl_chan, fsl_chan->slave_id, true);
>  	}
>  
> -	edma_writel(fsl_edma, EDMA_CR_ERGA | EDMA_CR_ERCA, regs->cr);
> +	if (!(fsl_edma->drvdata->flags & FSL_EDMA_DRV_SPLIT_REG))
> +		edma_writel(fsl_edma, EDMA_CR_ERGA | EDMA_CR_ERCA, regs->cr);
>  
>  	return 0;
>  }
> -- 
> 2.25.1
>
  

Patch

diff --git a/drivers/dma/fsl-edma-main.c b/drivers/dma/fsl-edma-main.c
index 52577fffc62b..aea7a703dda7 100644
--- a/drivers/dma/fsl-edma-main.c
+++ b/drivers/dma/fsl-edma-main.c
@@ -665,7 +665,8 @@  static int fsl_edma_resume_early(struct device *dev)
 			fsl_edma_chan_mux(fsl_chan, fsl_chan->slave_id, true);
 	}
 
-	edma_writel(fsl_edma, EDMA_CR_ERGA | EDMA_CR_ERCA, regs->cr);
+	if (!(fsl_edma->drvdata->flags & FSL_EDMA_DRV_SPLIT_REG))
+		edma_writel(fsl_edma, EDMA_CR_ERGA | EDMA_CR_ERCA, regs->cr);
 
 	return 0;
 }