dmaengine Archive on lore.kernel.org
 help / color / Atom feed
* [V3 1/2] dmaengine: fsl-qdma: fixed the source/destination descriptor format
@ 2019-05-22  3:21 Peng Ma
  2019-05-22  3:21 ` [V3 2/2] dmaengine: fsl-qdma: Add improvement Peng Ma
  2019-06-04 12:06 ` [V3 1/2] dmaengine: fsl-qdma: fixed the source/destination descriptor format Vinod Koul
  0 siblings, 2 replies; 4+ messages in thread
From: Peng Ma @ 2019-05-22  3:21 UTC (permalink / raw)
  To: vkoul, dan.j.williams; +Cc: dmaengine, linux-kernel, Peng Ma

CMD of Source/Destination descriptor format should be lower of
struct fsl_qdma_engine number data address.

Signed-off-by: Peng Ma <peng.ma@nxp.com>
---
changed for V3:
	- Delete macro to simplify code.

 drivers/dma/fsl-qdma.c |   18 ++++++++++--------
 1 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/drivers/dma/fsl-qdma.c b/drivers/dma/fsl-qdma.c
index aa1d0ae..da8fdf5 100644
--- a/drivers/dma/fsl-qdma.c
+++ b/drivers/dma/fsl-qdma.c
@@ -113,6 +113,7 @@
 /* Field definition for Descriptor offset */
 #define QDMA_CCDF_STATUS		20
 #define QDMA_CCDF_OFFSET		20
+#define QDMA_SDDF_CMD(x)		(((u64)(x)) << 32)
 
 /* Field definition for safe loop count*/
 #define FSL_QDMA_HALT_COUNT		1500
@@ -341,6 +342,7 @@ static void fsl_qdma_free_chan_resources(struct dma_chan *chan)
 static void fsl_qdma_comp_fill_memcpy(struct fsl_qdma_comp *fsl_comp,
 				      dma_addr_t dst, dma_addr_t src, u32 len)
 {
+	u32 cmd;
 	struct fsl_qdma_format *sdf, *ddf;
 	struct fsl_qdma_format *ccdf, *csgf_desc, *csgf_src, *csgf_dest;
 
@@ -369,14 +371,14 @@ static void fsl_qdma_comp_fill_memcpy(struct fsl_qdma_comp *fsl_comp,
 	/* This entry is the last entry. */
 	qdma_csgf_set_f(csgf_dest, len);
 	/* Descriptor Buffer */
-	sdf->data =
-		cpu_to_le64(FSL_QDMA_CMD_RWTTYPE <<
-			    FSL_QDMA_CMD_RWTTYPE_OFFSET);
-	ddf->data =
-		cpu_to_le64(FSL_QDMA_CMD_RWTTYPE <<
-			    FSL_QDMA_CMD_RWTTYPE_OFFSET);
-	ddf->data |=
-		cpu_to_le64(FSL_QDMA_CMD_LWC << FSL_QDMA_CMD_LWC_OFFSET);
+	cmd = cpu_to_le32(FSL_QDMA_CMD_RWTTYPE <<
+			  FSL_QDMA_CMD_RWTTYPE_OFFSET);
+	sdf->data = QDMA_SDDF_CMD(cmd);
+
+	cmd = cpu_to_le32(FSL_QDMA_CMD_RWTTYPE <<
+			  FSL_QDMA_CMD_RWTTYPE_OFFSET);
+	cmd |= cpu_to_le32(FSL_QDMA_CMD_LWC << FSL_QDMA_CMD_LWC_OFFSET);
+	ddf->data = QDMA_SDDF_CMD(cmd);
 }
 
 /*
-- 
1.7.1


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

* [V3 2/2] dmaengine: fsl-qdma: Add improvement
  2019-05-22  3:21 [V3 1/2] dmaengine: fsl-qdma: fixed the source/destination descriptor format Peng Ma
@ 2019-05-22  3:21 ` Peng Ma
  2019-06-04 12:07   ` Vinod Koul
  2019-06-04 12:06 ` [V3 1/2] dmaengine: fsl-qdma: fixed the source/destination descriptor format Vinod Koul
  1 sibling, 1 reply; 4+ messages in thread
From: Peng Ma @ 2019-05-22  3:21 UTC (permalink / raw)
  To: vkoul, dan.j.williams; +Cc: dmaengine, linux-kernel, Peng Ma

When an error occurs we should clean the error register then to return

Signed-off-by: Peng Ma <peng.ma@nxp.com>
---
changed for V3:
	- no changed.

 drivers/dma/fsl-qdma.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/drivers/dma/fsl-qdma.c b/drivers/dma/fsl-qdma.c
index da8fdf5..8e341c0 100644
--- a/drivers/dma/fsl-qdma.c
+++ b/drivers/dma/fsl-qdma.c
@@ -703,10 +703,8 @@ static irqreturn_t fsl_qdma_error_handler(int irq, void *dev_id)
 
 	intr = qdma_readl(fsl_qdma, status + FSL_QDMA_DEDR);
 
-	if (intr) {
+	if (intr)
 		dev_err(fsl_qdma->dma_dev.dev, "DMA transaction error!\n");
-		return IRQ_NONE;
-	}
 
 	qdma_writel(fsl_qdma, FSL_QDMA_DEDR_CLEAR, status + FSL_QDMA_DEDR);
 	return IRQ_HANDLED;
-- 
1.7.1


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

* Re: [V3 1/2] dmaengine: fsl-qdma: fixed the source/destination descriptor format
  2019-05-22  3:21 [V3 1/2] dmaengine: fsl-qdma: fixed the source/destination descriptor format Peng Ma
  2019-05-22  3:21 ` [V3 2/2] dmaengine: fsl-qdma: Add improvement Peng Ma
@ 2019-06-04 12:06 ` Vinod Koul
  1 sibling, 0 replies; 4+ messages in thread
From: Vinod Koul @ 2019-06-04 12:06 UTC (permalink / raw)
  To: Peng Ma; +Cc: dan.j.williams, dmaengine, linux-kernel

On 22-05-19, 03:21, Peng Ma wrote:
> CMD of Source/Destination descriptor format should be lower of
> struct fsl_qdma_engine number data address.

Applied, thanks

-- 
~Vinod

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

* Re: [V3 2/2] dmaengine: fsl-qdma: Add improvement
  2019-05-22  3:21 ` [V3 2/2] dmaengine: fsl-qdma: Add improvement Peng Ma
@ 2019-06-04 12:07   ` Vinod Koul
  0 siblings, 0 replies; 4+ messages in thread
From: Vinod Koul @ 2019-06-04 12:07 UTC (permalink / raw)
  To: Peng Ma; +Cc: dan.j.williams, dmaengine, linux-kernel

On 22-05-19, 03:21, Peng Ma wrote:
> When an error occurs we should clean the error register then to return

The patch title is supposed to tell us about the change. "Add
improvement: is a very generic term!

I have change title to "Continue to clear register on error" and applied

> 
> Signed-off-by: Peng Ma <peng.ma@nxp.com>
> ---
> changed for V3:
> 	- no changed.
> 
>  drivers/dma/fsl-qdma.c |    4 +---
>  1 files changed, 1 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/dma/fsl-qdma.c b/drivers/dma/fsl-qdma.c
> index da8fdf5..8e341c0 100644
> --- a/drivers/dma/fsl-qdma.c
> +++ b/drivers/dma/fsl-qdma.c
> @@ -703,10 +703,8 @@ static irqreturn_t fsl_qdma_error_handler(int irq, void *dev_id)
>  
>  	intr = qdma_readl(fsl_qdma, status + FSL_QDMA_DEDR);
>  
> -	if (intr) {
> +	if (intr)
>  		dev_err(fsl_qdma->dma_dev.dev, "DMA transaction error!\n");
> -		return IRQ_NONE;
> -	}
>  
>  	qdma_writel(fsl_qdma, FSL_QDMA_DEDR_CLEAR, status + FSL_QDMA_DEDR);
>  	return IRQ_HANDLED;
> -- 
> 1.7.1

-- 
~Vinod

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

end of thread, back to index

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-22  3:21 [V3 1/2] dmaengine: fsl-qdma: fixed the source/destination descriptor format Peng Ma
2019-05-22  3:21 ` [V3 2/2] dmaengine: fsl-qdma: Add improvement Peng Ma
2019-06-04 12:07   ` Vinod Koul
2019-06-04 12:06 ` [V3 1/2] dmaengine: fsl-qdma: fixed the source/destination descriptor format Vinod Koul

dmaengine Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/dmaengine/0 dmaengine/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dmaengine dmaengine/ https://lore.kernel.org/dmaengine \
		dmaengine@vger.kernel.org dmaengine@archiver.kernel.org
	public-inbox-index dmaengine


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.dmaengine


AGPL code for this site: git clone https://public-inbox.org/ public-inbox