dmaengine.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] dmaengine: xilinx: Add empty device_config function
@ 2020-06-13 14:58 Marek Vasut
  2020-06-14 15:38 ` Vinod Koul
  0 siblings, 1 reply; 9+ messages in thread
From: Marek Vasut @ 2020-06-13 14:58 UTC (permalink / raw)
  To: dmaengine
  Cc: Marek Vasut, Akinobu Mita, Kedareswara rao Appana, Michal Simek,
	Vinod Koul

Various DMA users call the dmaengine_slave_config() and expect it to
succeed, but that can only succeed if .device_config is implemented.
Add empty device_config function rather than patching all the places
which use dmaengine_slave_config().

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Kedareswara rao Appana <appana.durga.rao@xilinx.com>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Vinod Koul <vinod.koul@intel.com>
---
 drivers/dma/xilinx/xilinx_dma.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/dma/xilinx/xilinx_dma.c b/drivers/dma/xilinx/xilinx_dma.c
index 5429497d3560b..058150ff9e0d9 100644
--- a/drivers/dma/xilinx/xilinx_dma.c
+++ b/drivers/dma/xilinx/xilinx_dma.c
@@ -1637,6 +1637,17 @@ static void xilinx_dma_issue_pending(struct dma_chan *dchan)
 	spin_unlock_irqrestore(&chan->lock, flags);
 }
 
+/**
+ * xilinx_dma_issue_pending - Configure the DMA channel
+ * @dchan: DMA channel
+ * @config: channel configuration
+ */
+static int xilinx_dma_device_config(struct dma_chan *dchan,
+				    struct dma_slave_config *config)
+{
+	return 0;
+}
+
 /**
  * xilinx_dma_complete_descriptor - Mark the active descriptor as complete
  * @chan : xilinx DMA channel
@@ -3076,6 +3087,7 @@ static int xilinx_dma_probe(struct platform_device *pdev)
 	xdev->common.device_terminate_all = xilinx_dma_terminate_all;
 	xdev->common.device_tx_status = xilinx_dma_tx_status;
 	xdev->common.device_issue_pending = xilinx_dma_issue_pending;
+	xdev->common.device_config = xilinx_dma_device_config;
 	if (xdev->dma_config->dmatype == XDMA_TYPE_AXIDMA) {
 		dma_cap_set(DMA_CYCLIC, xdev->common.cap_mask);
 		xdev->common.device_prep_slave_sg = xilinx_dma_prep_slave_sg;
-- 
2.26.2


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

* Re: [PATCH] dmaengine: xilinx: Add empty device_config function
  2020-06-13 14:58 [PATCH] dmaengine: xilinx: Add empty device_config function Marek Vasut
@ 2020-06-14 15:38 ` Vinod Koul
  0 siblings, 0 replies; 9+ messages in thread
From: Vinod Koul @ 2020-06-14 15:38 UTC (permalink / raw)
  To: Marek Vasut
  Cc: dmaengine, Akinobu Mita, Kedareswara rao Appana, Michal Simek,
	Vinod Koul

On 13-06-20, 16:58, Marek Vasut wrote:
> Various DMA users call the dmaengine_slave_config() and expect it to
> succeed, but that can only succeed if .device_config is implemented.
> Add empty device_config function rather than patching all the places
> which use dmaengine_slave_config().
> 
> Signed-off-by: Marek Vasut <marex@denx.de>
> Cc: Akinobu Mita <akinobu.mita@gmail.com>
> Cc: Kedareswara rao Appana <appana.durga.rao@xilinx.com>
> Cc: Michal Simek <monstr@monstr.eu>
> Cc: Vinod Koul <vinod.koul@intel.com>

Umm, you should look up get_maintainers.pl to get right addresses :-)

> ---
>  drivers/dma/xilinx/xilinx_dma.c | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/drivers/dma/xilinx/xilinx_dma.c b/drivers/dma/xilinx/xilinx_dma.c
> index 5429497d3560b..058150ff9e0d9 100644
> --- a/drivers/dma/xilinx/xilinx_dma.c
> +++ b/drivers/dma/xilinx/xilinx_dma.c
> @@ -1637,6 +1637,17 @@ static void xilinx_dma_issue_pending(struct dma_chan *dchan)
>  	spin_unlock_irqrestore(&chan->lock, flags);
>  }
>  
> +/**
> + * xilinx_dma_issue_pending - Configure the DMA channel
> + * @dchan: DMA channel
> + * @config: channel configuration
> + */
> +static int xilinx_dma_device_config(struct dma_chan *dchan,
> +				    struct dma_slave_config *config)
> +{
> +	return 0;
> +}

NAK, the driver supports slave ops so it does not make sense for this to
be dummy, right fix would be to use these params for configuring dma
correctly

-- 
~Vinod

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

* Re: [PATCH] dmaengine: xilinx: Add empty device_config function
  2021-07-17 14:48       ` Marek Vasut
@ 2021-07-28 11:07         ` Vinod Koul
  0 siblings, 0 replies; 9+ messages in thread
From: Vinod Koul @ 2021-07-28 11:07 UTC (permalink / raw)
  To: Marek Vasut
  Cc: dmaengine, Akinobu Mita, Kedareswara rao Appana, Michal Simek,
	Vinod Koul

On 17-07-21, 16:48, Marek Vasut wrote:
> On 7/17/21 4:34 PM, Vinod Koul wrote:
> > On 17-07-21, 14:01, Marek Vasut wrote:
> > > On 7/17/21 1:36 PM, Vinod Koul wrote:
> > > > On 16-07-21, 20:22, Marek Vasut wrote:
> > > > > Various DMA users call the dmaengine_slave_config() and expect it to
> > > > > succeed, but that can only succeed if .device_config is implemented.
> > > > > Add empty device_config function rather than patching all the places
> > > > > which use dmaengine_slave_config().
> > > > 
> > > > .device_config is optional, Yes the dmaengine_slave_config() will check
> > > > and return error...
> > > > 
> > > > I think it would make sense to handle this in caller... (ignore
> > > > ENOSYS..) rather than add a dummy one
> > > 
> > > That's what I was trying to avoid -- patching all the places in kernel which
> > > might fail. Why handle it in caller ?
> > 
> > And how many places would that be..? The xilinx driver using xilinx
> > dma right>
> 
> git grep indicates around 170 matches on dmaengine_slave_config. In my case,
> it is generic PCM DMA in sound/soc/soc-generic-dmaengine-pcm.c .

Okay lets have this. Looks like kbuild-bot is not happy, can you fix
that and send update

-- 
~Vinod

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

* Re: [PATCH] dmaengine: xilinx: Add empty device_config function
  2021-07-16 18:22 Marek Vasut
  2021-07-17 11:36 ` Vinod Koul
@ 2021-07-18 19:38 ` kernel test robot
  1 sibling, 0 replies; 9+ messages in thread
From: kernel test robot @ 2021-07-18 19:38 UTC (permalink / raw)
  To: Marek Vasut, dmaengine
  Cc: kbuild-all, Marek Vasut, Akinobu Mita, Kedareswara rao Appana,
	Michal Simek, Vinod Koul

[-- Attachment #1: Type: text/plain, Size: 2464 bytes --]

Hi Marek,

I love your patch! Perhaps something to improve:

[auto build test WARNING on v5.14-rc1]
[also build test WARNING on next-20210716]
[cannot apply to xlnx/master]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Marek-Vasut/dmaengine-xilinx-Add-empty-device_config-function/20210718-111119
base:    e73f0f0ee7541171d89f2e2491130c7771ba58d3
config: arm-defconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 10.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/89cc716182246c22a6c7bdb666952b3cec945a0a
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Marek-Vasut/dmaengine-xilinx-Add-empty-device_config-function/20210718-111119
        git checkout 89cc716182246c22a6c7bdb666952b3cec945a0a
        # save the attached .config to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-10.3.0 make.cross O=build_dir ARCH=arm SHELL=/bin/bash drivers/dma/xilinx/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   drivers/dma/xilinx/xilinx_dma.c:800: warning: expecting prototype for xilinx_dma_tx_descriptor(). Prototype was for xilinx_dma_alloc_tx_descriptor() instead
>> drivers/dma/xilinx/xilinx_dma.c:1659: warning: expecting prototype for xilinx_dma_issue_pending(). Prototype was for xilinx_dma_device_config() instead
   drivers/dma/xilinx/xilinx_dma.c:2489: warning: expecting prototype for xilinx_dma_channel_set_config(). Prototype was for xilinx_vdma_channel_set_config() instead


vim +1659 drivers/dma/xilinx/xilinx_dma.c

  1651	
  1652	/**
  1653	 * xilinx_dma_issue_pending - Configure the DMA channel
  1654	 * @dchan: DMA channel
  1655	 * @config: channel configuration
  1656	 */
  1657	static int xilinx_dma_device_config(struct dma_chan *dchan,
  1658					    struct dma_slave_config *config)
> 1659	{
  1660		return 0;
  1661	}
  1662	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 54150 bytes --]

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

* Re: [PATCH] dmaengine: xilinx: Add empty device_config function
  2021-07-17 14:34     ` Vinod Koul
@ 2021-07-17 14:48       ` Marek Vasut
  2021-07-28 11:07         ` Vinod Koul
  0 siblings, 1 reply; 9+ messages in thread
From: Marek Vasut @ 2021-07-17 14:48 UTC (permalink / raw)
  To: Vinod Koul
  Cc: dmaengine, Akinobu Mita, Kedareswara rao Appana, Michal Simek,
	Vinod Koul

On 7/17/21 4:34 PM, Vinod Koul wrote:
> On 17-07-21, 14:01, Marek Vasut wrote:
>> On 7/17/21 1:36 PM, Vinod Koul wrote:
>>> On 16-07-21, 20:22, Marek Vasut wrote:
>>>> Various DMA users call the dmaengine_slave_config() and expect it to
>>>> succeed, but that can only succeed if .device_config is implemented.
>>>> Add empty device_config function rather than patching all the places
>>>> which use dmaengine_slave_config().
>>>
>>> .device_config is optional, Yes the dmaengine_slave_config() will check
>>> and return error...
>>>
>>> I think it would make sense to handle this in caller... (ignore
>>> ENOSYS..) rather than add a dummy one
>>
>> That's what I was trying to avoid -- patching all the places in kernel which
>> might fail. Why handle it in caller ?
> 
> And how many places would that be..? The xilinx driver using xilinx
> dma right>

git grep indicates around 170 matches on dmaengine_slave_config. In my 
case, it is generic PCM DMA in sound/soc/soc-generic-dmaengine-pcm.c .

>>>> Signed-off-by: Marek Vasut <marex@denx.de>
>>>> Cc: Akinobu Mita <akinobu.mita@gmail.com>
>>>> Cc: Kedareswara rao Appana <appana.durga.rao@xilinx.com>
>>>> Cc: Michal Simek <monstr@monstr.eu>
>>>> Cc: Vinod Koul <vinod.koul@intel.com>
>>>
>>> ummm..? you really need to update this :)
>>
>> I had the patch around for a while indeed, it fell through the cracks.
> 
> This has to be more than 3 yrs old then!

Four

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

* Re: [PATCH] dmaengine: xilinx: Add empty device_config function
  2021-07-17 12:01   ` Marek Vasut
@ 2021-07-17 14:34     ` Vinod Koul
  2021-07-17 14:48       ` Marek Vasut
  0 siblings, 1 reply; 9+ messages in thread
From: Vinod Koul @ 2021-07-17 14:34 UTC (permalink / raw)
  To: Marek Vasut
  Cc: dmaengine, Akinobu Mita, Kedareswara rao Appana, Michal Simek,
	Vinod Koul

On 17-07-21, 14:01, Marek Vasut wrote:
> On 7/17/21 1:36 PM, Vinod Koul wrote:
> > On 16-07-21, 20:22, Marek Vasut wrote:
> > > Various DMA users call the dmaengine_slave_config() and expect it to
> > > succeed, but that can only succeed if .device_config is implemented.
> > > Add empty device_config function rather than patching all the places
> > > which use dmaengine_slave_config().
> > 
> > .device_config is optional, Yes the dmaengine_slave_config() will check
> > and return error...
> > 
> > I think it would make sense to handle this in caller... (ignore
> > ENOSYS..) rather than add a dummy one
> 
> That's what I was trying to avoid -- patching all the places in kernel which
> might fail. Why handle it in caller ?

And how many places would that be..? The xilinx driver using xilinx
dma right>

> > > Signed-off-by: Marek Vasut <marex@denx.de>
> > > Cc: Akinobu Mita <akinobu.mita@gmail.com>
> > > Cc: Kedareswara rao Appana <appana.durga.rao@xilinx.com>
> > > Cc: Michal Simek <monstr@monstr.eu>
> > > Cc: Vinod Koul <vinod.koul@intel.com>
> > 
> > ummm..? you really need to update this :)
> 
> I had the patch around for a while indeed, it fell through the cracks.

This has to be more than 3 yrs old then!

-- 
~Vinod

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

* Re: [PATCH] dmaengine: xilinx: Add empty device_config function
  2021-07-17 11:36 ` Vinod Koul
@ 2021-07-17 12:01   ` Marek Vasut
  2021-07-17 14:34     ` Vinod Koul
  0 siblings, 1 reply; 9+ messages in thread
From: Marek Vasut @ 2021-07-17 12:01 UTC (permalink / raw)
  To: Vinod Koul
  Cc: dmaengine, Akinobu Mita, Kedareswara rao Appana, Michal Simek,
	Vinod Koul

On 7/17/21 1:36 PM, Vinod Koul wrote:
> On 16-07-21, 20:22, Marek Vasut wrote:
>> Various DMA users call the dmaengine_slave_config() and expect it to
>> succeed, but that can only succeed if .device_config is implemented.
>> Add empty device_config function rather than patching all the places
>> which use dmaengine_slave_config().
> 
> .device_config is optional, Yes the dmaengine_slave_config() will check
> and return error...
> 
> I think it would make sense to handle this in caller... (ignore
> ENOSYS..) rather than add a dummy one

That's what I was trying to avoid -- patching all the places in kernel 
which might fail. Why handle it in caller ?

>> Signed-off-by: Marek Vasut <marex@denx.de>
>> Cc: Akinobu Mita <akinobu.mita@gmail.com>
>> Cc: Kedareswara rao Appana <appana.durga.rao@xilinx.com>
>> Cc: Michal Simek <monstr@monstr.eu>
>> Cc: Vinod Koul <vinod.koul@intel.com>
> 
> ummm..? you really need to update this :)

I had the patch around for a while indeed, it fell through the cracks.

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

* Re: [PATCH] dmaengine: xilinx: Add empty device_config function
  2021-07-16 18:22 Marek Vasut
@ 2021-07-17 11:36 ` Vinod Koul
  2021-07-17 12:01   ` Marek Vasut
  2021-07-18 19:38 ` kernel test robot
  1 sibling, 1 reply; 9+ messages in thread
From: Vinod Koul @ 2021-07-17 11:36 UTC (permalink / raw)
  To: Marek Vasut
  Cc: dmaengine, Akinobu Mita, Kedareswara rao Appana, Michal Simek,
	Vinod Koul

On 16-07-21, 20:22, Marek Vasut wrote:
> Various DMA users call the dmaengine_slave_config() and expect it to
> succeed, but that can only succeed if .device_config is implemented.
> Add empty device_config function rather than patching all the places
> which use dmaengine_slave_config().

.device_config is optional, Yes the dmaengine_slave_config() will check
and return error...

I think it would make sense to handle this in caller... (ignore
ENOSYS..) rather than add a dummy one

> 
> Signed-off-by: Marek Vasut <marex@denx.de>
> Cc: Akinobu Mita <akinobu.mita@gmail.com>
> Cc: Kedareswara rao Appana <appana.durga.rao@xilinx.com>
> Cc: Michal Simek <monstr@monstr.eu>
> Cc: Vinod Koul <vinod.koul@intel.com>

ummm..? you really need to update this :)

> ---
>  drivers/dma/xilinx/xilinx_dma.c | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/drivers/dma/xilinx/xilinx_dma.c b/drivers/dma/xilinx/xilinx_dma.c
> index 4b9530a7bf65..d6f4bf0d50e8 100644
> --- a/drivers/dma/xilinx/xilinx_dma.c
> +++ b/drivers/dma/xilinx/xilinx_dma.c
> @@ -1658,6 +1658,17 @@ static void xilinx_dma_issue_pending(struct dma_chan *dchan)
>  	spin_unlock_irqrestore(&chan->lock, flags);
>  }
>  
> +/**
> + * xilinx_dma_issue_pending - Configure the DMA channel
> + * @dchan: DMA channel
> + * @config: channel configuration
> + */
> +static int xilinx_dma_device_config(struct dma_chan *dchan,
> +				    struct dma_slave_config *config)
> +{
> +	return 0;
> +}
> +
>  /**
>   * xilinx_dma_complete_descriptor - Mark the active descriptor as complete
>   * @chan : xilinx DMA channel
> @@ -3096,6 +3107,7 @@ static int xilinx_dma_probe(struct platform_device *pdev)
>  	xdev->common.device_synchronize = xilinx_dma_synchronize;
>  	xdev->common.device_tx_status = xilinx_dma_tx_status;
>  	xdev->common.device_issue_pending = xilinx_dma_issue_pending;
> +	xdev->common.device_config = xilinx_dma_device_config;
>  	if (xdev->dma_config->dmatype == XDMA_TYPE_AXIDMA) {
>  		dma_cap_set(DMA_CYCLIC, xdev->common.cap_mask);
>  		xdev->common.device_prep_slave_sg = xilinx_dma_prep_slave_sg;
> -- 
> 2.30.2

-- 
~Vinod

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

* [PATCH] dmaengine: xilinx: Add empty device_config function
@ 2021-07-16 18:22 Marek Vasut
  2021-07-17 11:36 ` Vinod Koul
  2021-07-18 19:38 ` kernel test robot
  0 siblings, 2 replies; 9+ messages in thread
From: Marek Vasut @ 2021-07-16 18:22 UTC (permalink / raw)
  To: dmaengine
  Cc: Marek Vasut, Akinobu Mita, Kedareswara rao Appana, Michal Simek,
	Vinod Koul

Various DMA users call the dmaengine_slave_config() and expect it to
succeed, but that can only succeed if .device_config is implemented.
Add empty device_config function rather than patching all the places
which use dmaengine_slave_config().

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Kedareswara rao Appana <appana.durga.rao@xilinx.com>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Vinod Koul <vinod.koul@intel.com>
---
 drivers/dma/xilinx/xilinx_dma.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/dma/xilinx/xilinx_dma.c b/drivers/dma/xilinx/xilinx_dma.c
index 4b9530a7bf65..d6f4bf0d50e8 100644
--- a/drivers/dma/xilinx/xilinx_dma.c
+++ b/drivers/dma/xilinx/xilinx_dma.c
@@ -1658,6 +1658,17 @@ static void xilinx_dma_issue_pending(struct dma_chan *dchan)
 	spin_unlock_irqrestore(&chan->lock, flags);
 }
 
+/**
+ * xilinx_dma_issue_pending - Configure the DMA channel
+ * @dchan: DMA channel
+ * @config: channel configuration
+ */
+static int xilinx_dma_device_config(struct dma_chan *dchan,
+				    struct dma_slave_config *config)
+{
+	return 0;
+}
+
 /**
  * xilinx_dma_complete_descriptor - Mark the active descriptor as complete
  * @chan : xilinx DMA channel
@@ -3096,6 +3107,7 @@ static int xilinx_dma_probe(struct platform_device *pdev)
 	xdev->common.device_synchronize = xilinx_dma_synchronize;
 	xdev->common.device_tx_status = xilinx_dma_tx_status;
 	xdev->common.device_issue_pending = xilinx_dma_issue_pending;
+	xdev->common.device_config = xilinx_dma_device_config;
 	if (xdev->dma_config->dmatype == XDMA_TYPE_AXIDMA) {
 		dma_cap_set(DMA_CYCLIC, xdev->common.cap_mask);
 		xdev->common.device_prep_slave_sg = xilinx_dma_prep_slave_sg;
-- 
2.30.2


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

end of thread, other threads:[~2021-07-28 11:08 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-13 14:58 [PATCH] dmaengine: xilinx: Add empty device_config function Marek Vasut
2020-06-14 15:38 ` Vinod Koul
2021-07-16 18:22 Marek Vasut
2021-07-17 11:36 ` Vinod Koul
2021-07-17 12:01   ` Marek Vasut
2021-07-17 14:34     ` Vinod Koul
2021-07-17 14:48       ` Marek Vasut
2021-07-28 11:07         ` Vinod Koul
2021-07-18 19:38 ` kernel test robot

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