linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] dmaengine: bam-dma: fix a warning about missing capabilities
@ 2015-03-05 13:03 Stanimir Varbanov
  2015-03-05 16:15 ` Vinod Koul
  0 siblings, 1 reply; 3+ messages in thread
From: Stanimir Varbanov @ 2015-03-05 13:03 UTC (permalink / raw)
  To: Vinod Koul; +Cc: Dan Williams, dmaengine, linux-kernel, linux-arm-msm

Avoid the warning below triggered during dmaengine async device
registration.

WARNING: CPU: 1 PID: 1 at linux/drivers/dma/dmaengine.c:863
dma_async_device_register+0x2a8/0x4b8()
this driver doesn't support generic slave capabilities reporting

To do that fill mandatory .directions bit mask,
.src/dst_addr_widths and .residue_granularity dma_device fields
with appropriate values.

Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
---

v1 -> v2

  - the patch subject has been changed
  - now fill also .residue_granularity and src/dts_addr_widths
  - added the warning in patch description

v1 can be found at https://lkml.org/lkml/2015/3/4/896

 drivers/dma/qcom_bam_dma.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/dma/qcom_bam_dma.c b/drivers/dma/qcom_bam_dma.c
index c3113e3..9c914d6 100644
--- a/drivers/dma/qcom_bam_dma.c
+++ b/drivers/dma/qcom_bam_dma.c
@@ -1143,6 +1143,10 @@ static int bam_dma_probe(struct platform_device *pdev)
 	dma_cap_set(DMA_SLAVE, bdev->common.cap_mask);
 
 	/* initialize dmaengine apis */
+	bdev->common.directions = BIT(DMA_DEV_TO_MEM) | BIT(DMA_MEM_TO_DEV);
+	bdev->common.residue_granularity = DMA_RESIDUE_GRANULARITY_SEGMENT;
+	bdev->common.src_addr_widths = DMA_SLAVE_BUSWIDTH_4_BYTES;
+	bdev->common.dst_addr_widths = DMA_SLAVE_BUSWIDTH_4_BYTES;
 	bdev->common.device_alloc_chan_resources = bam_alloc_chan;
 	bdev->common.device_free_chan_resources = bam_free_chan;
 	bdev->common.device_prep_slave_sg = bam_prep_slave_sg;
-- 
1.7.0.4


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

* Re: [PATCH v2] dmaengine: bam-dma: fix a warning about missing capabilities
  2015-03-05 13:03 [PATCH v2] dmaengine: bam-dma: fix a warning about missing capabilities Stanimir Varbanov
@ 2015-03-05 16:15 ` Vinod Koul
  2015-03-05 16:29   ` Stanimir Varbanov
  0 siblings, 1 reply; 3+ messages in thread
From: Vinod Koul @ 2015-03-05 16:15 UTC (permalink / raw)
  To: Stanimir Varbanov; +Cc: Dan Williams, dmaengine, linux-kernel, linux-arm-msm

On Thu, Mar 05, 2015 at 03:03:04PM +0200, Stanimir Varbanov wrote:
> Avoid the warning below triggered during dmaengine async device
> registration.
> 
> WARNING: CPU: 1 PID: 1 at linux/drivers/dma/dmaengine.c:863
> dma_async_device_register+0x2a8/0x4b8()
> this driver doesn't support generic slave capabilities reporting
> 
> To do that fill mandatory .directions bit mask,
> .src/dst_addr_widths and .residue_granularity dma_device fields
> with appropriate values.
> 
Applied, thanks

-- 
~Vinod

> Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
> ---
> 
> v1 -> v2
> 
>   - the patch subject has been changed
>   - now fill also .residue_granularity and src/dts_addr_widths
>   - added the warning in patch description
> 
> v1 can be found at https://lkml.org/lkml/2015/3/4/896
> 
>  drivers/dma/qcom_bam_dma.c |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/dma/qcom_bam_dma.c b/drivers/dma/qcom_bam_dma.c
> index c3113e3..9c914d6 100644
> --- a/drivers/dma/qcom_bam_dma.c
> +++ b/drivers/dma/qcom_bam_dma.c
> @@ -1143,6 +1143,10 @@ static int bam_dma_probe(struct platform_device *pdev)
>  	dma_cap_set(DMA_SLAVE, bdev->common.cap_mask);
>  
>  	/* initialize dmaengine apis */
> +	bdev->common.directions = BIT(DMA_DEV_TO_MEM) | BIT(DMA_MEM_TO_DEV);
> +	bdev->common.residue_granularity = DMA_RESIDUE_GRANULARITY_SEGMENT;
> +	bdev->common.src_addr_widths = DMA_SLAVE_BUSWIDTH_4_BYTES;
> +	bdev->common.dst_addr_widths = DMA_SLAVE_BUSWIDTH_4_BYTES;
>  	bdev->common.device_alloc_chan_resources = bam_alloc_chan;
>  	bdev->common.device_free_chan_resources = bam_free_chan;
>  	bdev->common.device_prep_slave_sg = bam_prep_slave_sg;
> -- 
> 1.7.0.4
> 

-- 

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

* Re: [PATCH v2] dmaengine: bam-dma: fix a warning about missing capabilities
  2015-03-05 16:15 ` Vinod Koul
@ 2015-03-05 16:29   ` Stanimir Varbanov
  0 siblings, 0 replies; 3+ messages in thread
From: Stanimir Varbanov @ 2015-03-05 16:29 UTC (permalink / raw)
  To: Vinod Koul
  Cc: Stanimir Varbanov, Dan Williams, dmaengine, linux-kernel, linux-arm-msm

On 03/05/2015 06:15 PM, Vinod Koul wrote:
> On Thu, Mar 05, 2015 at 03:03:04PM +0200, Stanimir Varbanov wrote:
>> Avoid the warning below triggered during dmaengine async device
>> registration.
>>
>> WARNING: CPU: 1 PID: 1 at linux/drivers/dma/dmaengine.c:863
>> dma_async_device_register+0x2a8/0x4b8()
>> this driver doesn't support generic slave capabilities reporting
>>
>> To do that fill mandatory .directions bit mask,
>> .src/dst_addr_widths and .residue_granularity dma_device fields
>> with appropriate values.
>>
> Applied, thanks
> 

Thanks Vinod!

While you are at bam-dma driver, I have posted one more patch which
could be treated as a fix here [1]. If it is fine with you could you
take it, too?

[1] https://lkml.org/lkml/2015/2/19/285

-- 
regards,
Stan

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

end of thread, other threads:[~2015-03-05 16:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-05 13:03 [PATCH v2] dmaengine: bam-dma: fix a warning about missing capabilities Stanimir Varbanov
2015-03-05 16:15 ` Vinod Koul
2015-03-05 16:29   ` Stanimir Varbanov

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).