linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [LINUX PATCH 0/4] dmaengine: xilinx_dma: Bug fixes
@ 2017-12-21 10:11 Kedareswara rao Appana
  2017-12-21 10:11 ` [LINUX PATCH 1/4] dmaengine: xilinx_dma: Fix dma_get_slave_caps() API failures Kedareswara rao Appana
                   ` (3 more replies)
  0 siblings, 4 replies; 14+ messages in thread
From: Kedareswara rao Appana @ 2017-12-21 10:11 UTC (permalink / raw)
  To: dan.j.williams, vinod.koul, michal.simek, appanad, lars,
	akinobu.mita, joabreu, mike.looijmans, kedare06
  Cc: dmaengine, linux-arm-kernel, linux-kernel

This patch series does the below
--> Fixes sparse warnings in the driver.
--> Fixes race conditions in the driver for cdma.
--> Fixes issues with the dma_get_slave_caps() API failures.

This patch series got created on top of below commit 
in the slave-dma.git topic/xilinx branch.
"dmaengine: xilinx_dma: Fix typos"

Kedareswara rao Appana (4):
  dmaengine: xilinx_dma: Fix dma_get_slave_caps() API failures
  dmaengine: xilinx_dma: Fix race condition in the driver for cdma
  dmaengine: xilinx_dma: Fix compilation warning
  dmaengine: xilinx_dma: Free BD consistent memory

 drivers/dma/xilinx/xilinx_dma.c | 23 ++++++++++++++++++++---
 1 file changed, 20 insertions(+), 3 deletions(-)

-- 
2.7.4

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

* [LINUX PATCH 1/4] dmaengine: xilinx_dma: Fix dma_get_slave_caps() API failures
  2017-12-21 10:11 [LINUX PATCH 0/4] dmaengine: xilinx_dma: Bug fixes Kedareswara rao Appana
@ 2017-12-21 10:11 ` Kedareswara rao Appana
  2018-01-03  3:57   ` Vinod Koul
  2017-12-21 10:11 ` [LINUX PATCH 2/4] dmaengine: xilinx_dma: Fix race condition in the driver for cdma Kedareswara rao Appana
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 14+ messages in thread
From: Kedareswara rao Appana @ 2017-12-21 10:11 UTC (permalink / raw)
  To: dan.j.williams, vinod.koul, michal.simek, appanad, lars,
	akinobu.mita, joabreu, mike.looijmans, kedare06
  Cc: dmaengine, linux-arm-kernel, linux-kernel

When client driver uses dma_get_slave_caps() api,
it checks for certain fields of dma_device struct
currently driver is not settings few fields resulting
dma_get_slave_caps() returning failure.

This patch fixes this issue by populating proper values
to the struct dma_device fields.

Signed-off-by: Kedareswara rao Appana <appanad@xilinx.com>
---
 drivers/dma/xilinx/xilinx_dma.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/dma/xilinx/xilinx_dma.c b/drivers/dma/xilinx/xilinx_dma.c
index 88d317d..21ac954 100644
--- a/drivers/dma/xilinx/xilinx_dma.c
+++ b/drivers/dma/xilinx/xilinx_dma.c
@@ -2398,6 +2398,7 @@ static int xilinx_dma_chan_probe(struct xilinx_dma_device *xdev,
 		chan->direction = DMA_MEM_TO_DEV;
 		chan->id = chan_id;
 		chan->tdest = chan_id;
+		xdev->common.directions = BIT(DMA_MEM_TO_DEV);
 
 		chan->ctrl_offset = XILINX_DMA_MM2S_CTRL_OFFSET;
 		if (xdev->dma_config->dmatype == XDMA_TYPE_VDMA) {
@@ -2415,6 +2416,7 @@ static int xilinx_dma_chan_probe(struct xilinx_dma_device *xdev,
 		chan->direction = DMA_DEV_TO_MEM;
 		chan->id = chan_id;
 		chan->tdest = chan_id - xdev->nr_channels;
+		xdev->common.directions |= BIT(DMA_DEV_TO_MEM);
 
 		chan->ctrl_offset = XILINX_DMA_S2MM_CTRL_OFFSET;
 		if (xdev->dma_config->dmatype == XDMA_TYPE_VDMA) {
@@ -2629,6 +2631,8 @@ static int xilinx_dma_probe(struct platform_device *pdev)
 		dma_cap_set(DMA_PRIVATE, xdev->common.cap_mask);
 	}
 
+	xdev->common.dst_addr_widths = BIT(addr_width / 8);
+	xdev->common.src_addr_widths = BIT(addr_width / 8);
 	xdev->common.device_alloc_chan_resources =
 				xilinx_dma_alloc_chan_resources;
 	xdev->common.device_free_chan_resources =
-- 
2.7.4

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

* [LINUX PATCH 2/4] dmaengine: xilinx_dma: Fix race condition in the driver for cdma
  2017-12-21 10:11 [LINUX PATCH 0/4] dmaengine: xilinx_dma: Bug fixes Kedareswara rao Appana
  2017-12-21 10:11 ` [LINUX PATCH 1/4] dmaengine: xilinx_dma: Fix dma_get_slave_caps() API failures Kedareswara rao Appana
@ 2017-12-21 10:11 ` Kedareswara rao Appana
  2018-01-03  3:58   ` Vinod Koul
  2017-12-21 10:11 ` [LINUX PATCH 3/4] dmaengine: xilinx_dma: Fix compilation warning Kedareswara rao Appana
  2017-12-21 10:11 ` [LINUX PATCH 4/4] dmaengine: xilinx_dma: Free BD consistent memory Kedareswara rao Appana
  3 siblings, 1 reply; 14+ messages in thread
From: Kedareswara rao Appana @ 2017-12-21 10:11 UTC (permalink / raw)
  To: dan.j.williams, vinod.koul, michal.simek, appanad, lars,
	akinobu.mita, joabreu, mike.looijmans, kedare06
  Cc: dmaengine, linux-arm-kernel, linux-kernel

when hardware is idle we need to toggle the SG bit
in the control register, inorder to update new value to the
current descriptor register other wise undefined
results will occur.

This patch updates the same.

Signed-off-by: Kedareswara rao Appana <appanad@xilinx.com>
---
 drivers/dma/xilinx/xilinx_dma.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/dma/xilinx/xilinx_dma.c b/drivers/dma/xilinx/xilinx_dma.c
index 21ac954..8467671 100644
--- a/drivers/dma/xilinx/xilinx_dma.c
+++ b/drivers/dma/xilinx/xilinx_dma.c
@@ -1204,6 +1204,12 @@ static void xilinx_cdma_start_transfer(struct xilinx_dma_chan *chan)
 	}
 
 	if (chan->has_sg) {
+		dma_ctrl_clr(chan, XILINX_DMA_REG_DMACR,
+			     XILINX_CDMA_CR_SGMODE);
+
+		dma_ctrl_set(chan, XILINX_DMA_REG_DMACR,
+			     XILINX_CDMA_CR_SGMODE);
+
 		xilinx_write(chan, XILINX_DMA_REG_CURDESC,
 			     head_desc->async_tx.phys);
 
@@ -2052,6 +2058,10 @@ static int xilinx_dma_terminate_all(struct dma_chan *dchan)
 		chan->cyclic = false;
 	}
 
+	if ((chan->xdev->dma_config->dmatype == XDMA_TYPE_CDMA) && chan->has_sg)
+		dma_ctrl_clr(chan, XILINX_DMA_REG_DMACR,
+			     XILINX_CDMA_CR_SGMODE);
+
 	return 0;
 }
 
-- 
2.7.4

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

* [LINUX PATCH 3/4] dmaengine: xilinx_dma: Fix compilation warning
  2017-12-21 10:11 [LINUX PATCH 0/4] dmaengine: xilinx_dma: Bug fixes Kedareswara rao Appana
  2017-12-21 10:11 ` [LINUX PATCH 1/4] dmaengine: xilinx_dma: Fix dma_get_slave_caps() API failures Kedareswara rao Appana
  2017-12-21 10:11 ` [LINUX PATCH 2/4] dmaengine: xilinx_dma: Fix race condition in the driver for cdma Kedareswara rao Appana
@ 2017-12-21 10:11 ` Kedareswara rao Appana
  2018-01-03  3:59   ` Vinod Koul
  2017-12-21 10:11 ` [LINUX PATCH 4/4] dmaengine: xilinx_dma: Free BD consistent memory Kedareswara rao Appana
  3 siblings, 1 reply; 14+ messages in thread
From: Kedareswara rao Appana @ 2017-12-21 10:11 UTC (permalink / raw)
  To: dan.j.williams, vinod.koul, michal.simek, appanad, lars,
	akinobu.mita, joabreu, mike.looijmans, kedare06
  Cc: dmaengine, linux-arm-kernel, linux-kernel

This patch fixes the below sparse warning in the driver
drivers/dma/xilinx/xilinx_dma.c: In function ‘xilinx_vdma_dma_prep_interleaved’:
drivers/dma/xilinx/xilinx_dma.c:1614:43: warning: variable ‘prev’ set but not used [-Wunused-but-set-variable]
  struct xilinx_vdma_tx_segment *segment, *prev = NULL;

Signed-off-by: Kedareswara rao Appana <appanad@xilinx.com>
---
 drivers/dma/xilinx/xilinx_dma.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/dma/xilinx/xilinx_dma.c b/drivers/dma/xilinx/xilinx_dma.c
index 8467671..845e638 100644
--- a/drivers/dma/xilinx/xilinx_dma.c
+++ b/drivers/dma/xilinx/xilinx_dma.c
@@ -1611,7 +1611,7 @@ xilinx_vdma_dma_prep_interleaved(struct dma_chan *dchan,
 {
 	struct xilinx_dma_chan *chan = to_xilinx_chan(dchan);
 	struct xilinx_dma_tx_descriptor *desc;
-	struct xilinx_vdma_tx_segment *segment, *prev = NULL;
+	struct xilinx_vdma_tx_segment *segment;
 	struct xilinx_vdma_desc_hw *hw;
 
 	if (!is_slave_direction(xt->dir))
@@ -1665,8 +1665,6 @@ xilinx_vdma_dma_prep_interleaved(struct dma_chan *dchan,
 	/* Insert the segment into the descriptor segments list. */
 	list_add_tail(&segment->node, &desc->segments);
 
-	prev = segment;
-
 	/* Link the last hardware descriptor with the first. */
 	segment = list_first_entry(&desc->segments,
 				   struct xilinx_vdma_tx_segment, node);
-- 
2.7.4

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

* [LINUX PATCH 4/4] dmaengine: xilinx_dma: Free BD consistent memory
  2017-12-21 10:11 [LINUX PATCH 0/4] dmaengine: xilinx_dma: Bug fixes Kedareswara rao Appana
                   ` (2 preceding siblings ...)
  2017-12-21 10:11 ` [LINUX PATCH 3/4] dmaengine: xilinx_dma: Fix compilation warning Kedareswara rao Appana
@ 2017-12-21 10:11 ` Kedareswara rao Appana
  3 siblings, 0 replies; 14+ messages in thread
From: Kedareswara rao Appana @ 2017-12-21 10:11 UTC (permalink / raw)
  To: dan.j.williams, vinod.koul, michal.simek, appanad, lars,
	akinobu.mita, joabreu, mike.looijmans, kedare06
  Cc: dmaengine, linux-arm-kernel, linux-kernel, Radhey Shyam Pandey

Free BD consistent memory while freeing the channel
i.e in free_chan_resources.

Signed-off-by: Radhey Shyam Pandey <radheys@xilinx.com>
Signed-off-by: Kedareswara rao Appana <appanad@xilinx.com>
---
 drivers/dma/xilinx/xilinx_dma.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/dma/xilinx/xilinx_dma.c b/drivers/dma/xilinx/xilinx_dma.c
index 845e638..a9edbd8 100644
--- a/drivers/dma/xilinx/xilinx_dma.c
+++ b/drivers/dma/xilinx/xilinx_dma.c
@@ -764,6 +764,11 @@ static void xilinx_dma_free_chan_resources(struct dma_chan *dchan)
 		INIT_LIST_HEAD(&chan->free_seg_list);
 		spin_unlock_irqrestore(&chan->lock, flags);
 
+		/* Free memory that is allocated for BD */
+		dma_free_coherent(chan->dev, sizeof(*chan->seg_v) *
+				  XILINX_DMA_NUM_DESCS, chan->seg_v,
+				  chan->seg_p);
+
 		/* Free Memory that is allocated for cyclic DMA Mode */
 		dma_free_coherent(chan->dev, sizeof(*chan->cyclic_seg_v),
 				  chan->cyclic_seg_v, chan->cyclic_seg_p);
-- 
2.7.4

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

* Re: [LINUX PATCH 1/4] dmaengine: xilinx_dma: Fix dma_get_slave_caps() API failures
  2017-12-21 10:11 ` [LINUX PATCH 1/4] dmaengine: xilinx_dma: Fix dma_get_slave_caps() API failures Kedareswara rao Appana
@ 2018-01-03  3:57   ` Vinod Koul
  2018-01-03  5:09     ` Appana Durga Kedareswara Rao
  0 siblings, 1 reply; 14+ messages in thread
From: Vinod Koul @ 2018-01-03  3:57 UTC (permalink / raw)
  To: Kedareswara rao Appana
  Cc: dan.j.williams, michal.simek, appanad, lars, akinobu.mita,
	joabreu, mike.looijmans, kedare06, dmaengine, linux-arm-kernel,
	linux-kernel

On Thu, Dec 21, 2017 at 03:41:35PM +0530, Kedareswara rao Appana wrote:

Patch title should say what is does, not the cause/effect

An apt title might be "populate dma caps properly"

> When client driver uses dma_get_slave_caps() api,
> it checks for certain fields of dma_device struct
> currently driver is not settings few fields resulting
> dma_get_slave_caps() returning failure.

It would help to mention the fields you are setting here

> 
> This patch fixes this issue by populating proper values
> to the struct dma_device fields.
> 
> Signed-off-by: Kedareswara rao Appana <appanad@xilinx.com>
> ---
>  drivers/dma/xilinx/xilinx_dma.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/dma/xilinx/xilinx_dma.c b/drivers/dma/xilinx/xilinx_dma.c
> index 88d317d..21ac954 100644
> --- a/drivers/dma/xilinx/xilinx_dma.c
> +++ b/drivers/dma/xilinx/xilinx_dma.c
> @@ -2398,6 +2398,7 @@ static int xilinx_dma_chan_probe(struct xilinx_dma_device *xdev,
>  		chan->direction = DMA_MEM_TO_DEV;
>  		chan->id = chan_id;
>  		chan->tdest = chan_id;
> +		xdev->common.directions = BIT(DMA_MEM_TO_DEV);
>  
>  		chan->ctrl_offset = XILINX_DMA_MM2S_CTRL_OFFSET;
>  		if (xdev->dma_config->dmatype == XDMA_TYPE_VDMA) {
> @@ -2415,6 +2416,7 @@ static int xilinx_dma_chan_probe(struct xilinx_dma_device *xdev,
>  		chan->direction = DMA_DEV_TO_MEM;
>  		chan->id = chan_id;
>  		chan->tdest = chan_id - xdev->nr_channels;
> +		xdev->common.directions |= BIT(DMA_DEV_TO_MEM);
>  
>  		chan->ctrl_offset = XILINX_DMA_S2MM_CTRL_OFFSET;
>  		if (xdev->dma_config->dmatype == XDMA_TYPE_VDMA) {
> @@ -2629,6 +2631,8 @@ static int xilinx_dma_probe(struct platform_device *pdev)
>  		dma_cap_set(DMA_PRIVATE, xdev->common.cap_mask);
>  	}
>  
> +	xdev->common.dst_addr_widths = BIT(addr_width / 8);
> +	xdev->common.src_addr_widths = BIT(addr_width / 8);
>  	xdev->common.device_alloc_chan_resources =
>  				xilinx_dma_alloc_chan_resources;
>  	xdev->common.device_free_chan_resources =
> -- 
> 2.7.4
> 
> --
> To unsubscribe from this list: send the line "unsubscribe dmaengine" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
~Vinod

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

* Re: [LINUX PATCH 2/4] dmaengine: xilinx_dma: Fix race condition in the driver for cdma
  2017-12-21 10:11 ` [LINUX PATCH 2/4] dmaengine: xilinx_dma: Fix race condition in the driver for cdma Kedareswara rao Appana
@ 2018-01-03  3:58   ` Vinod Koul
  2018-01-03  5:10     ` Appana Durga Kedareswara Rao
  0 siblings, 1 reply; 14+ messages in thread
From: Vinod Koul @ 2018-01-03  3:58 UTC (permalink / raw)
  To: Kedareswara rao Appana
  Cc: dan.j.williams, michal.simek, appanad, lars, akinobu.mita,
	joabreu, mike.looijmans, kedare06, dmaengine, linux-arm-kernel,
	linux-kernel

On Thu, Dec 21, 2017 at 03:41:36PM +0530, Kedareswara rao Appana wrote:

same issue for patch title here too

> when hardware is idle we need to toggle the SG bit
> in the control register, inorder to update new value to the
> current descriptor register other wise undefined
> results will occur.

can you try making it bit more clear..

> 
> This patch updates the same.
> 
> Signed-off-by: Kedareswara rao Appana <appanad@xilinx.com>
> ---
>  drivers/dma/xilinx/xilinx_dma.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/drivers/dma/xilinx/xilinx_dma.c b/drivers/dma/xilinx/xilinx_dma.c
> index 21ac954..8467671 100644
> --- a/drivers/dma/xilinx/xilinx_dma.c
> +++ b/drivers/dma/xilinx/xilinx_dma.c
> @@ -1204,6 +1204,12 @@ static void xilinx_cdma_start_transfer(struct xilinx_dma_chan *chan)
>  	}
>  
>  	if (chan->has_sg) {
> +		dma_ctrl_clr(chan, XILINX_DMA_REG_DMACR,
> +			     XILINX_CDMA_CR_SGMODE);
> +
> +		dma_ctrl_set(chan, XILINX_DMA_REG_DMACR,
> +			     XILINX_CDMA_CR_SGMODE);
> +
>  		xilinx_write(chan, XILINX_DMA_REG_CURDESC,
>  			     head_desc->async_tx.phys);
>  
> @@ -2052,6 +2058,10 @@ static int xilinx_dma_terminate_all(struct dma_chan *dchan)
>  		chan->cyclic = false;
>  	}
>  
> +	if ((chan->xdev->dma_config->dmatype == XDMA_TYPE_CDMA) && chan->has_sg)
> +		dma_ctrl_clr(chan, XILINX_DMA_REG_DMACR,
> +			     XILINX_CDMA_CR_SGMODE);
> +
>  	return 0;
>  }
>  
> -- 
> 2.7.4
> 

-- 
~Vinod

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

* Re: [LINUX PATCH 3/4] dmaengine: xilinx_dma: Fix compilation warning
  2017-12-21 10:11 ` [LINUX PATCH 3/4] dmaengine: xilinx_dma: Fix compilation warning Kedareswara rao Appana
@ 2018-01-03  3:59   ` Vinod Koul
  2018-01-03  5:13     ` Appana Durga Kedareswara Rao
  0 siblings, 1 reply; 14+ messages in thread
From: Vinod Koul @ 2018-01-03  3:59 UTC (permalink / raw)
  To: Kedareswara rao Appana
  Cc: dan.j.williams, michal.simek, appanad, lars, akinobu.mita,
	joabreu, mike.looijmans, kedare06, dmaengine, linux-arm-kernel,
	linux-kernel

On Thu, Dec 21, 2017 at 03:41:37PM +0530, Kedareswara rao Appana wrote:

Fix title here too

BTW whats with LINUX tag in patches, pls drop them

> This patch fixes the below sparse warning in the driver
> drivers/dma/xilinx/xilinx_dma.c: In function ‘xilinx_vdma_dma_prep_interleaved’:
> drivers/dma/xilinx/xilinx_dma.c:1614:43: warning: variable ‘prev’ set but not used [-Wunused-but-set-variable]
>   struct xilinx_vdma_tx_segment *segment, *prev = NULL;
> 
> Signed-off-by: Kedareswara rao Appana <appanad@xilinx.com>
> ---
>  drivers/dma/xilinx/xilinx_dma.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/dma/xilinx/xilinx_dma.c b/drivers/dma/xilinx/xilinx_dma.c
> index 8467671..845e638 100644
> --- a/drivers/dma/xilinx/xilinx_dma.c
> +++ b/drivers/dma/xilinx/xilinx_dma.c
> @@ -1611,7 +1611,7 @@ xilinx_vdma_dma_prep_interleaved(struct dma_chan *dchan,
>  {
>  	struct xilinx_dma_chan *chan = to_xilinx_chan(dchan);
>  	struct xilinx_dma_tx_descriptor *desc;
> -	struct xilinx_vdma_tx_segment *segment, *prev = NULL;
> +	struct xilinx_vdma_tx_segment *segment;
>  	struct xilinx_vdma_desc_hw *hw;
>  
>  	if (!is_slave_direction(xt->dir))
> @@ -1665,8 +1665,6 @@ xilinx_vdma_dma_prep_interleaved(struct dma_chan *dchan,
>  	/* Insert the segment into the descriptor segments list. */
>  	list_add_tail(&segment->node, &desc->segments);
>  
> -	prev = segment;
> -
>  	/* Link the last hardware descriptor with the first. */
>  	segment = list_first_entry(&desc->segments,
>  				   struct xilinx_vdma_tx_segment, node);
> -- 
> 2.7.4
> 

-- 
~Vinod

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

* RE: [LINUX PATCH 1/4] dmaengine: xilinx_dma: Fix dma_get_slave_caps() API failures
  2018-01-03  3:57   ` Vinod Koul
@ 2018-01-03  5:09     ` Appana Durga Kedareswara Rao
  0 siblings, 0 replies; 14+ messages in thread
From: Appana Durga Kedareswara Rao @ 2018-01-03  5:09 UTC (permalink / raw)
  To: Vinod Koul
  Cc: dan.j.williams, michal.simek, lars, akinobu.mita, joabreu,
	mike.looijmans, kedare06, dmaengine, linux-arm-kernel,
	linux-kernel

Hi Vinod,

	Thanks for the review... 
>
>On Thu, Dec 21, 2017 at 03:41:35PM +0530, Kedareswara rao Appana wrote:
>
>Patch title should say what is does, not the cause/effect

Sure will fix in v2... 

>
>An apt title might be "populate dma caps properly"
>
>> When client driver uses dma_get_slave_caps() api, it checks for
>> certain fields of dma_device struct currently driver is not settings
>> few fields resulting
>> dma_get_slave_caps() returning failure.
>
>It would help to mention the fields you are setting here

Sure will fix in v2... 

Regards,
Kedar.

>
>>
>> This patch fixes this issue by populating proper values to the struct
>> dma_device fields.
>>
>> Signed-off-by: Kedareswara rao Appana <appanad@xilinx.com>
>> ---
>>  drivers/dma/xilinx/xilinx_dma.c | 4 ++++
>>  1 file changed, 4 insertions(+)
>>
>> diff --git a/drivers/dma/xilinx/xilinx_dma.c
>> b/drivers/dma/xilinx/xilinx_dma.c index 88d317d..21ac954 100644
>> --- a/drivers/dma/xilinx/xilinx_dma.c
>> +++ b/drivers/dma/xilinx/xilinx_dma.c
>> @@ -2398,6 +2398,7 @@ static int xilinx_dma_chan_probe(struct
>xilinx_dma_device *xdev,
>>  		chan->direction = DMA_MEM_TO_DEV;
>>  		chan->id = chan_id;
>>  		chan->tdest = chan_id;
>> +		xdev->common.directions = BIT(DMA_MEM_TO_DEV);
>>
>>  		chan->ctrl_offset = XILINX_DMA_MM2S_CTRL_OFFSET;
>>  		if (xdev->dma_config->dmatype == XDMA_TYPE_VDMA) { @@ -
>2415,6
>> +2416,7 @@ static int xilinx_dma_chan_probe(struct xilinx_dma_device *xdev,
>>  		chan->direction = DMA_DEV_TO_MEM;
>>  		chan->id = chan_id;
>>  		chan->tdest = chan_id - xdev->nr_channels;
>> +		xdev->common.directions |= BIT(DMA_DEV_TO_MEM);
>>
>>  		chan->ctrl_offset = XILINX_DMA_S2MM_CTRL_OFFSET;
>>  		if (xdev->dma_config->dmatype == XDMA_TYPE_VDMA) { @@ -
>2629,6
>> +2631,8 @@ static int xilinx_dma_probe(struct platform_device *pdev)
>>  		dma_cap_set(DMA_PRIVATE, xdev->common.cap_mask);
>>  	}
>>
>> +	xdev->common.dst_addr_widths = BIT(addr_width / 8);
>> +	xdev->common.src_addr_widths = BIT(addr_width / 8);
>>  	xdev->common.device_alloc_chan_resources =
>>  				xilinx_dma_alloc_chan_resources;
>>  	xdev->common.device_free_chan_resources =
>> --
>> 2.7.4
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe dmaengine"
>> in the body of a message to majordomo@vger.kernel.org More majordomo
>> info at  http://vger.kernel.org/majordomo-info.html
>
>--
>~Vinod

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

* RE: [LINUX PATCH 2/4] dmaengine: xilinx_dma: Fix race condition in the driver for cdma
  2018-01-03  3:58   ` Vinod Koul
@ 2018-01-03  5:10     ` Appana Durga Kedareswara Rao
  0 siblings, 0 replies; 14+ messages in thread
From: Appana Durga Kedareswara Rao @ 2018-01-03  5:10 UTC (permalink / raw)
  To: Vinod Koul
  Cc: dan.j.williams, michal.simek, lars, akinobu.mita, joabreu,
	mike.looijmans, kedare06, dmaengine, linux-arm-kernel,
	linux-kernel

Hi Vinod,

	Thanks for the review... 

>
>On Thu, Dec 21, 2017 at 03:41:36PM +0530, Kedareswara rao Appana wrote:
>
>same issue for patch title here too

Ok will fix in v2... 

>
>> when hardware is idle we need to toggle the SG bit in the control
>> register, inorder to update new value to the current descriptor
>> register other wise undefined results will occur.
>
>can you try making it bit more clear..

Sure will fix in v2... 

Regards,
Kedar.

>
>>
>> This patch updates the same.
>>
>> Signed-off-by: Kedareswara rao Appana <appanad@xilinx.com>
>> ---
>>  drivers/dma/xilinx/xilinx_dma.c | 10 ++++++++++
>>  1 file changed, 10 insertions(+)
>>
>> diff --git a/drivers/dma/xilinx/xilinx_dma.c
>> b/drivers/dma/xilinx/xilinx_dma.c index 21ac954..8467671 100644
>> --- a/drivers/dma/xilinx/xilinx_dma.c
>> +++ b/drivers/dma/xilinx/xilinx_dma.c
>> @@ -1204,6 +1204,12 @@ static void xilinx_cdma_start_transfer(struct
>xilinx_dma_chan *chan)
>>  	}
>>
>>  	if (chan->has_sg) {
>> +		dma_ctrl_clr(chan, XILINX_DMA_REG_DMACR,
>> +			     XILINX_CDMA_CR_SGMODE);
>> +
>> +		dma_ctrl_set(chan, XILINX_DMA_REG_DMACR,
>> +			     XILINX_CDMA_CR_SGMODE);
>> +
>>  		xilinx_write(chan, XILINX_DMA_REG_CURDESC,
>>  			     head_desc->async_tx.phys);
>>
>> @@ -2052,6 +2058,10 @@ static int xilinx_dma_terminate_all(struct dma_chan
>*dchan)
>>  		chan->cyclic = false;
>>  	}
>>
>> +	if ((chan->xdev->dma_config->dmatype == XDMA_TYPE_CDMA) &&
>chan->has_sg)
>> +		dma_ctrl_clr(chan, XILINX_DMA_REG_DMACR,
>> +			     XILINX_CDMA_CR_SGMODE);
>> +
>>  	return 0;
>>  }
>>
>> --
>> 2.7.4
>>
>
>--
>~Vinod

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

* RE: [LINUX PATCH 3/4] dmaengine: xilinx_dma: Fix compilation warning
  2018-01-03  3:59   ` Vinod Koul
@ 2018-01-03  5:13     ` Appana Durga Kedareswara Rao
  2018-01-03  5:27       ` Vinod Koul
  0 siblings, 1 reply; 14+ messages in thread
From: Appana Durga Kedareswara Rao @ 2018-01-03  5:13 UTC (permalink / raw)
  To: Vinod Koul
  Cc: dan.j.williams, michal.simek, lars, akinobu.mita, joabreu,
	mike.looijmans, kedare06, dmaengine, linux-arm-kernel,
	linux-kernel

Hi Vinod,

	Thanks for the review... 

>
>On Thu, Dec 21, 2017 at 03:41:37PM +0530, Kedareswara rao Appana wrote:
>
>Fix title here too

Sure will fix in v2... 

>
>BTW whats with LINUX tag in patches, pls drop them

Ok will mention the Linux tag info in the cover letter patch from the next patch series on wards...

Regards,
Kedar.

>
>> This patch fixes the below sparse warning in the driver
>> drivers/dma/xilinx/xilinx_dma.c: In function
>‘xilinx_vdma_dma_prep_interleaved’:
>> drivers/dma/xilinx/xilinx_dma.c:1614:43: warning: variable ‘prev’ set but not
>used [-Wunused-but-set-variable]
>>   struct xilinx_vdma_tx_segment *segment, *prev = NULL;
>>
>> Signed-off-by: Kedareswara rao Appana <appanad@xilinx.com>
>> ---
>>  drivers/dma/xilinx/xilinx_dma.c | 4 +---
>>  1 file changed, 1 insertion(+), 3 deletions(-)
>>
>> diff --git a/drivers/dma/xilinx/xilinx_dma.c
>> b/drivers/dma/xilinx/xilinx_dma.c index 8467671..845e638 100644
>> --- a/drivers/dma/xilinx/xilinx_dma.c
>> +++ b/drivers/dma/xilinx/xilinx_dma.c
>> @@ -1611,7 +1611,7 @@ xilinx_vdma_dma_prep_interleaved(struct dma_chan
>> *dchan,  {
>>  	struct xilinx_dma_chan *chan = to_xilinx_chan(dchan);
>>  	struct xilinx_dma_tx_descriptor *desc;
>> -	struct xilinx_vdma_tx_segment *segment, *prev = NULL;
>> +	struct xilinx_vdma_tx_segment *segment;
>>  	struct xilinx_vdma_desc_hw *hw;
>>
>>  	if (!is_slave_direction(xt->dir))
>> @@ -1665,8 +1665,6 @@ xilinx_vdma_dma_prep_interleaved(struct dma_chan
>*dchan,
>>  	/* Insert the segment into the descriptor segments list. */
>>  	list_add_tail(&segment->node, &desc->segments);
>>
>> -	prev = segment;
>> -
>>  	/* Link the last hardware descriptor with the first. */
>>  	segment = list_first_entry(&desc->segments,
>>  				   struct xilinx_vdma_tx_segment, node);
>> --
>> 2.7.4
>>
>
>--
>~Vinod

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

* Re: [LINUX PATCH 3/4] dmaengine: xilinx_dma: Fix compilation warning
  2018-01-03  5:13     ` Appana Durga Kedareswara Rao
@ 2018-01-03  5:27       ` Vinod Koul
  2018-01-03  6:10         ` Appana Durga Kedareswara Rao
  2018-01-03  9:09         ` Appana Durga Kedareswara Rao
  0 siblings, 2 replies; 14+ messages in thread
From: Vinod Koul @ 2018-01-03  5:27 UTC (permalink / raw)
  To: Appana Durga Kedareswara Rao
  Cc: dan.j.williams, michal.simek, lars, akinobu.mita, joabreu,
	mike.looijmans, kedare06, dmaengine, linux-arm-kernel,
	linux-kernel

On Wed, Jan 03, 2018 at 05:13:29AM +0000, Appana Durga Kedareswara Rao wrote:
> Hi Vinod,
> 
> 	Thanks for the review... 
> 
> >
> >On Thu, Dec 21, 2017 at 03:41:37PM +0530, Kedareswara rao Appana wrote:
> >
> >Fix title here too
> 
> Sure will fix in v2... 
> 
> >
> >BTW whats with LINUX tag in patches, pls drop them
> 
> Ok will mention the Linux tag info in the cover letter patch from the next
> patch series on wards...

Please wrap your replies within 80chars. It is very hard to read! I have
reflown for readability

Can you explain what you mean by that info, what are you trying to convey?

-- 
~Vinod

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

* RE: [LINUX PATCH 3/4] dmaengine: xilinx_dma: Fix compilation warning
  2018-01-03  5:27       ` Vinod Koul
@ 2018-01-03  6:10         ` Appana Durga Kedareswara Rao
  2018-01-03  9:09         ` Appana Durga Kedareswara Rao
  1 sibling, 0 replies; 14+ messages in thread
From: Appana Durga Kedareswara Rao @ 2018-01-03  6:10 UTC (permalink / raw)
  To: Vinod Koul
  Cc: dan.j.williams, michal.simek, lars, akinobu.mita, joabreu,
	mike.looijmans, kedare06, dmaengine, linux-arm-kernel,
	linux-kernel

Hi Vinod,


>On Wed, Jan 03, 2018 at 05:13:29AM +0000, Appana Durga Kedareswara Rao
>wrote:
>> Hi Vinod,
>>
>> 	Thanks for the review...
>>
>> >
>> >On Thu, Dec 21, 2017 at 03:41:37PM +0530, Kedareswara rao Appana wrote:
>> >
>> >Fix title here too
>>
>> Sure will fix in v2...
>>
>> >
>> >BTW whats with LINUX tag in patches, pls drop them
>>
>> Ok will mention the Linux tag info in the cover letter patch from the
>> next patch series on wards...
>
>Please wrap your replies within 80chars. It is very hard to read! I have reflown for
>readability

Sure will take care of it next time onwards... 

>
>Can you explain what you mean by that info, what are you trying to convey?

What I mean here is will mention the Linux kernel tag
Information in the cover letter patch...

Regards,
Kedar.

>
>--
>~Vinod

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

* RE: [LINUX PATCH 3/4] dmaengine: xilinx_dma: Fix compilation warning
  2018-01-03  5:27       ` Vinod Koul
  2018-01-03  6:10         ` Appana Durga Kedareswara Rao
@ 2018-01-03  9:09         ` Appana Durga Kedareswara Rao
  1 sibling, 0 replies; 14+ messages in thread
From: Appana Durga Kedareswara Rao @ 2018-01-03  9:09 UTC (permalink / raw)
  To: Vinod Koul
  Cc: dan.j.williams, michal.simek, lars, akinobu.mita, joabreu,
	mike.looijmans, kedare06, dmaengine, linux-arm-kernel,
	linux-kernel

Hi,

<Snip>
>>> >BTW whats with LINUX tag in patches, pls drop them
>>>
>>> Ok will mention the Linux tag info in the cover letter patch from the
>>> next patch series on wards...
>>
>>Please wrap your replies within 80chars. It is very hard to read! I have reflown
>for
>>readability
>
>Sure will take care of it next time onwards...
>
>>
>>Can you explain what you mean by that info, what are you trying to convey?
>
>What I mean here is will mention the Linux kernel tag
>Information in the cover letter patch...

Oops sorry I misunderstood your comment... 
In my company we have internally different projects
To differentiate b/w them we usually use LINUX prefix
By mistake I have added the LINUX prefix in this patch series
I have removed it in the v2 series... 

Regards,
Kedar.

>
>Regards,
>Kedar.
>
>>
>>--
>>~Vinod

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

end of thread, other threads:[~2018-01-03  9:09 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-21 10:11 [LINUX PATCH 0/4] dmaengine: xilinx_dma: Bug fixes Kedareswara rao Appana
2017-12-21 10:11 ` [LINUX PATCH 1/4] dmaengine: xilinx_dma: Fix dma_get_slave_caps() API failures Kedareswara rao Appana
2018-01-03  3:57   ` Vinod Koul
2018-01-03  5:09     ` Appana Durga Kedareswara Rao
2017-12-21 10:11 ` [LINUX PATCH 2/4] dmaengine: xilinx_dma: Fix race condition in the driver for cdma Kedareswara rao Appana
2018-01-03  3:58   ` Vinod Koul
2018-01-03  5:10     ` Appana Durga Kedareswara Rao
2017-12-21 10:11 ` [LINUX PATCH 3/4] dmaengine: xilinx_dma: Fix compilation warning Kedareswara rao Appana
2018-01-03  3:59   ` Vinod Koul
2018-01-03  5:13     ` Appana Durga Kedareswara Rao
2018-01-03  5:27       ` Vinod Koul
2018-01-03  6:10         ` Appana Durga Kedareswara Rao
2018-01-03  9:09         ` Appana Durga Kedareswara Rao
2017-12-21 10:11 ` [LINUX PATCH 4/4] dmaengine: xilinx_dma: Free BD consistent memory Kedareswara rao Appana

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).