diff mbox series

[v7,08/11] dmaengine: dw: Add dummy device_caps callback

Message ID 20200709224550.15539-9-Sergey.Semin@baikalelectronics.ru (mailing list archive)
State Changes Requested
Headers show
Series dmaengine: dw: Take Baikal-T1 SoC DW DMAC peculiarities into account | expand

Commit Message

Serge Semin July 9, 2020, 10:45 p.m. UTC
Since some DW DMA controllers (like one installed on Baikal-T1 SoC) may
have non-uniform DMA capabilities per device channels, let's add
the DW DMA specific device_caps callback to expose that specifics up to
the DMA consumer. It's a dummy function for now. We'll fill it in with
capabilities overrides in the next commits.

Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
Cc: Alexey Malahov <Alexey.Malahov@baikalelectronics.ru>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: linux-mips@vger.kernel.org
Cc: devicetree@vger.kernel.org

---

Changelog v3:
- This is a new patch created as a result of the discussion with Vinud and
  Andy in the framework of DW DMA burst and LLP capabilities.
---
 drivers/dma/dw/core.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Andy Shevchenko July 10, 2020, 8:51 a.m. UTC | #1
On Fri, Jul 10, 2020 at 01:45:47AM +0300, Serge Semin wrote:
> Since some DW DMA controllers (like one installed on Baikal-T1 SoC) may
> have non-uniform DMA capabilities per device channels, let's add
> the DW DMA specific device_caps callback to expose that specifics up to
> the DMA consumer. It's a dummy function for now. We'll fill it in with
> capabilities overrides in the next commits.

Just a reminder (mainly to Vinod) of my view to this.
Unneeded churn, should be folded to patch 9.

> Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
> Cc: Alexey Malahov <Alexey.Malahov@baikalelectronics.ru>
> Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
> Cc: Arnd Bergmann <arnd@arndb.de>
> Cc: Rob Herring <robh+dt@kernel.org>
> Cc: linux-mips@vger.kernel.org
> Cc: devicetree@vger.kernel.org
> 
> ---
> 
> Changelog v3:
> - This is a new patch created as a result of the discussion with Vinud and
>   Andy in the framework of DW DMA burst and LLP capabilities.
> ---
>  drivers/dma/dw/core.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/dma/dw/core.c b/drivers/dma/dw/core.c
> index fb95920c429e..ceded21537e2 100644
> --- a/drivers/dma/dw/core.c
> +++ b/drivers/dma/dw/core.c
> @@ -1049,6 +1049,11 @@ static void dwc_free_chan_resources(struct dma_chan *chan)
>  	dev_vdbg(chan2dev(chan), "%s: done\n", __func__);
>  }
>  
> +static void dwc_caps(struct dma_chan *chan, struct dma_slave_caps *caps)
> +{
> +
> +}
> +
>  int do_dma_probe(struct dw_dma_chip *chip)
>  {
>  	struct dw_dma *dw = chip->dw;
> @@ -1214,6 +1219,7 @@ int do_dma_probe(struct dw_dma_chip *chip)
>  	dw->dma.device_prep_dma_memcpy = dwc_prep_dma_memcpy;
>  	dw->dma.device_prep_slave_sg = dwc_prep_slave_sg;
>  
> +	dw->dma.device_caps = dwc_caps;
>  	dw->dma.device_config = dwc_config;
>  	dw->dma.device_pause = dwc_pause;
>  	dw->dma.device_resume = dwc_resume;
> -- 
> 2.26.2
>
Andy Shevchenko July 10, 2020, 8:52 a.m. UTC | #2
On Fri, Jul 10, 2020 at 11:51:23AM +0300, Andy Shevchenko wrote:
> On Fri, Jul 10, 2020 at 01:45:47AM +0300, Serge Semin wrote:
> > Since some DW DMA controllers (like one installed on Baikal-T1 SoC) may
> > have non-uniform DMA capabilities per device channels, let's add
> > the DW DMA specific device_caps callback to expose that specifics up to
> > the DMA consumer. It's a dummy function for now. We'll fill it in with
> > capabilities overrides in the next commits.
> 
> Just a reminder (mainly to Vinod) of my view to this.
> Unneeded churn, should be folded to patch 9.

Sorry, s/9/10/ (also the sign that they should be in one, rather than spread
over the series).
Serge Semin July 10, 2020, 9:45 a.m. UTC | #3
On Fri, Jul 10, 2020 at 11:51:23AM +0300, Andy Shevchenko wrote:
> On Fri, Jul 10, 2020 at 01:45:47AM +0300, Serge Semin wrote:
> > Since some DW DMA controllers (like one installed on Baikal-T1 SoC) may
> > have non-uniform DMA capabilities per device channels, let's add
> > the DW DMA specific device_caps callback to expose that specifics up to
> > the DMA consumer. It's a dummy function for now. We'll fill it in with
> > capabilities overrides in the next commits.
> 

> Just a reminder (mainly to Vinod) of my view to this.
> Unneeded churn, should be folded to patch 9.

Just to remind (mainly to Vinod). That's Andy's bikeshedding.
This isn't a churn, since it's totally normal to design the patchset in this way:
introduce a callback, then fill it in with functionality.

-Sergey

> 
> > Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
> > Cc: Alexey Malahov <Alexey.Malahov@baikalelectronics.ru>
> > Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
> > Cc: Arnd Bergmann <arnd@arndb.de>
> > Cc: Rob Herring <robh+dt@kernel.org>
> > Cc: linux-mips@vger.kernel.org
> > Cc: devicetree@vger.kernel.org
> > 
> > ---
> > 
> > Changelog v3:
> > - This is a new patch created as a result of the discussion with Vinud and
> >   Andy in the framework of DW DMA burst and LLP capabilities.
> > ---
> >  drivers/dma/dw/core.c | 6 ++++++
> >  1 file changed, 6 insertions(+)
> > 
> > diff --git a/drivers/dma/dw/core.c b/drivers/dma/dw/core.c
> > index fb95920c429e..ceded21537e2 100644
> > --- a/drivers/dma/dw/core.c
> > +++ b/drivers/dma/dw/core.c
> > @@ -1049,6 +1049,11 @@ static void dwc_free_chan_resources(struct dma_chan *chan)
> >  	dev_vdbg(chan2dev(chan), "%s: done\n", __func__);
> >  }
> >  
> > +static void dwc_caps(struct dma_chan *chan, struct dma_slave_caps *caps)
> > +{
> > +
> > +}
> > +
> >  int do_dma_probe(struct dw_dma_chip *chip)
> >  {
> >  	struct dw_dma *dw = chip->dw;
> > @@ -1214,6 +1219,7 @@ int do_dma_probe(struct dw_dma_chip *chip)
> >  	dw->dma.device_prep_dma_memcpy = dwc_prep_dma_memcpy;
> >  	dw->dma.device_prep_slave_sg = dwc_prep_slave_sg;
> >  
> > +	dw->dma.device_caps = dwc_caps;
> >  	dw->dma.device_config = dwc_config;
> >  	dw->dma.device_pause = dwc_pause;
> >  	dw->dma.device_resume = dwc_resume;
> > -- 
> > 2.26.2
> > 
> 
> -- 
> With Best Regards,
> Andy Shevchenko
> 
>
Vinod Koul July 15, 2020, 12:01 p.m. UTC | #4
On 10-07-20, 12:45, Serge Semin wrote:
> On Fri, Jul 10, 2020 at 11:51:23AM +0300, Andy Shevchenko wrote:
> > On Fri, Jul 10, 2020 at 01:45:47AM +0300, Serge Semin wrote:
> > > Since some DW DMA controllers (like one installed on Baikal-T1 SoC) may
> > > have non-uniform DMA capabilities per device channels, let's add
> > > the DW DMA specific device_caps callback to expose that specifics up to
> > > the DMA consumer. It's a dummy function for now. We'll fill it in with
> > > capabilities overrides in the next commits.
> > 
> 
> > Just a reminder (mainly to Vinod) of my view to this.
> > Unneeded churn, should be folded to patch 9.
> 
> Just to remind (mainly to Vinod). That's Andy's bikeshedding.
> This isn't a churn, since it's totally normal to design the patchset in this way:
> introduce a callback, then fill it in with functionality.

Looking at both patches, they do one thing, so please fold them in..
diff mbox series

Patch

diff --git a/drivers/dma/dw/core.c b/drivers/dma/dw/core.c
index fb95920c429e..ceded21537e2 100644
--- a/drivers/dma/dw/core.c
+++ b/drivers/dma/dw/core.c
@@ -1049,6 +1049,11 @@  static void dwc_free_chan_resources(struct dma_chan *chan)
 	dev_vdbg(chan2dev(chan), "%s: done\n", __func__);
 }
 
+static void dwc_caps(struct dma_chan *chan, struct dma_slave_caps *caps)
+{
+
+}
+
 int do_dma_probe(struct dw_dma_chip *chip)
 {
 	struct dw_dma *dw = chip->dw;
@@ -1214,6 +1219,7 @@  int do_dma_probe(struct dw_dma_chip *chip)
 	dw->dma.device_prep_dma_memcpy = dwc_prep_dma_memcpy;
 	dw->dma.device_prep_slave_sg = dwc_prep_slave_sg;
 
+	dw->dma.device_caps = dwc_caps;
 	dw->dma.device_config = dwc_config;
 	dw->dma.device_pause = dwc_pause;
 	dw->dma.device_resume = dwc_resume;