All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Dan Williams <dan.j.williams@intel.com>
Cc: linux-kernel@vger.kernel.org,
	Linus Walleij <linus.ml.walleij@gmail.com>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 2/3] dmaengine: add wrapper functions for dmaengine
Date: Fri, 24 Sep 2010 09:25:23 +0200	[thread overview]
Message-ID: <20100924072523.GM23406@pengutronix.de> (raw)
In-Reply-To: <AANLkTin8v_29HESnmhE5==3OLmb29bmoOY1iona4C+eD@mail.gmail.com>

Hi Dan,

On Thu, Sep 23, 2010 at 12:53:58PM -0700, Dan Williams wrote:
> > diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
> > index 0df7864..635c60b 100644
> > --- a/include/linux/dmaengine.h
> > +++ b/include/linux/dmaengine.h
> > @@ -491,6 +491,47 @@ struct dma_device {
> >        void (*device_issue_pending)(struct dma_chan *chan);
> >  };
> >
> > +static inline int dmaengine_device_control(struct dma_chan *chan,
> > +                                          enum dma_ctrl_cmd cmd,
> > +                                          unsigned long arg)
> > +{
> > +       return chan->device->device_control(chan, cmd, arg);
> > +}
> > +
> > +static inline int dmaengine_slave_config(struct dma_chan *chan,
> > +                                         struct dma_slave_config *config)
> > +{
> > +       return dmaengine_device_control(chan, DMA_SLAVE_CONFIG,
> > +                       (unsigned long)config);
> > +}
> > +
> > +static inline int dmaengine_terminate_all(struct dma_chan *chan)
> > +{
> > +       return dmaengine_device_control(chan, DMA_TERMINATE_ALL, 0);
> > +}
> > +
> > +static inline struct dma_async_tx_descriptor *dmaengine_prep_slave_sg(
> > +               struct dma_chan *chan, struct scatterlist *sgl,
> > +               unsigned int sg_len, enum dma_data_direction direction,
> > +               unsigned long flags)
> > +{
> > +       return chan->device->device_prep_slave_sg(chan, sgl, sg_len, direction,
> > +                       flags);
> > +}
> > +
> > +static inline struct dma_async_tx_descriptor *dmaengine_prep_cyclic(
> > +               struct dma_chan *chan, dma_addr_t buf_addr, size_t buf_len,
> > +               size_t period_len, enum dma_data_direction direction)
> > +{
> > +       return chan->device->device_prep_dma_cyclic(chan, buf_addr, buf_len,
> > +                       period_len, direction);
> > +}
> > +
> 
> No strong disagreements on the above, the type safety of
> dmaengine_slave_config() is nice.

So you have only small disagreements? ;) I can drop the dmaengine_prep_*
functions and only keep the device_control functions if like it better.

> 
> > +static inline int dmaengine_tx_submit(struct dma_async_tx_descriptor *desc)
> > +{
> > +       return desc->tx_submit(desc);
> > +}
> 
> This one can drop the tx.

You mean the function should be named dmaengine_submit?

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

WARNING: multiple messages have this Message-ID (diff)
From: s.hauer@pengutronix.de (Sascha Hauer)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/3] dmaengine: add wrapper functions for dmaengine
Date: Fri, 24 Sep 2010 09:25:23 +0200	[thread overview]
Message-ID: <20100924072523.GM23406@pengutronix.de> (raw)
In-Reply-To: <AANLkTin8v_29HESnmhE5==3OLmb29bmoOY1iona4C+eD@mail.gmail.com>

Hi Dan,

On Thu, Sep 23, 2010 at 12:53:58PM -0700, Dan Williams wrote:
> > diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
> > index 0df7864..635c60b 100644
> > --- a/include/linux/dmaengine.h
> > +++ b/include/linux/dmaengine.h
> > @@ -491,6 +491,47 @@ struct dma_device {
> > ? ? ? ?void (*device_issue_pending)(struct dma_chan *chan);
> > ?};
> >
> > +static inline int dmaengine_device_control(struct dma_chan *chan,
> > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?enum dma_ctrl_cmd cmd,
> > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?unsigned long arg)
> > +{
> > + ? ? ? return chan->device->device_control(chan, cmd, arg);
> > +}
> > +
> > +static inline int dmaengine_slave_config(struct dma_chan *chan,
> > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? struct dma_slave_config *config)
> > +{
> > + ? ? ? return dmaengine_device_control(chan, DMA_SLAVE_CONFIG,
> > + ? ? ? ? ? ? ? ? ? ? ? (unsigned long)config);
> > +}
> > +
> > +static inline int dmaengine_terminate_all(struct dma_chan *chan)
> > +{
> > + ? ? ? return dmaengine_device_control(chan, DMA_TERMINATE_ALL, 0);
> > +}
> > +
> > +static inline struct dma_async_tx_descriptor *dmaengine_prep_slave_sg(
> > + ? ? ? ? ? ? ? struct dma_chan *chan, struct scatterlist *sgl,
> > + ? ? ? ? ? ? ? unsigned int sg_len, enum dma_data_direction direction,
> > + ? ? ? ? ? ? ? unsigned long flags)
> > +{
> > + ? ? ? return chan->device->device_prep_slave_sg(chan, sgl, sg_len, direction,
> > + ? ? ? ? ? ? ? ? ? ? ? flags);
> > +}
> > +
> > +static inline struct dma_async_tx_descriptor *dmaengine_prep_cyclic(
> > + ? ? ? ? ? ? ? struct dma_chan *chan, dma_addr_t buf_addr, size_t buf_len,
> > + ? ? ? ? ? ? ? size_t period_len, enum dma_data_direction direction)
> > +{
> > + ? ? ? return chan->device->device_prep_dma_cyclic(chan, buf_addr, buf_len,
> > + ? ? ? ? ? ? ? ? ? ? ? period_len, direction);
> > +}
> > +
> 
> No strong disagreements on the above, the type safety of
> dmaengine_slave_config() is nice.

So you have only small disagreements? ;) I can drop the dmaengine_prep_*
functions and only keep the device_control functions if like it better.

> 
> > +static inline int dmaengine_tx_submit(struct dma_async_tx_descriptor *desc)
> > +{
> > + ? ? ? return desc->tx_submit(desc);
> > +}
> 
> This one can drop the tx.

You mean the function should be named dmaengine_submit?

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

  reply	other threads:[~2010-09-24  7:25 UTC|newest]

Thread overview: 78+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-16 11:07 [RFC] dmaengine: assorted patches and Freescale SDMA support Sascha Hauer
2010-08-16 11:07 ` Sascha Hauer
2010-08-16 11:07 ` [PATCH 1/3] dmaengine: add possibility for cyclic transfers Sascha Hauer
2010-08-16 11:07   ` Sascha Hauer
2010-08-16 11:56   ` Lothar Waßmann
2010-08-16 11:56     ` Lothar Waßmann
2010-08-16 12:27     ` Linus Walleij
2010-08-16 12:27       ` Linus Walleij
2010-08-16 12:32     ` Sascha Hauer
2010-08-16 12:32       ` Sascha Hauer
2010-08-16 12:22   ` Linus Walleij
2010-08-16 12:22     ` Linus Walleij
2010-09-20 13:01   ` Sascha Hauer
2010-09-20 13:01     ` Sascha Hauer
2010-09-23 19:42     ` Dan Williams
2010-09-23 19:42       ` Dan Williams
2010-09-24  7:25       ` Sascha Hauer
2010-09-24  7:25         ` Sascha Hauer
2010-08-16 11:07 ` [PATCH 2/3] dmaengine: add wrapper functions for dmaengine Sascha Hauer
2010-08-16 11:07   ` Sascha Hauer
2010-08-23  7:17   ` Sascha Hauer
2010-08-23  7:17     ` Sascha Hauer
2010-09-20 13:02   ` Sascha Hauer
2010-09-23 19:53   ` Dan Williams
2010-09-23 19:53     ` Dan Williams
2010-09-24  7:25     ` Sascha Hauer [this message]
2010-09-24  7:25       ` Sascha Hauer
2010-09-24 15:45       ` Dan Williams
2010-09-24 15:45         ` Dan Williams
2010-08-16 11:07 ` [PATCH 3/3] dmaengine: Add Freescale i.MX SDMA support Sascha Hauer
2010-08-16 11:07   ` Sascha Hauer
2010-08-16 12:21   ` Linus Walleij
2010-08-16 12:21     ` Linus Walleij
2010-08-16 14:15     ` Sascha Hauer
2010-08-16 14:15       ` Sascha Hauer
2010-08-17  4:36       ` Baruch Siach
2010-08-17  4:36         ` Baruch Siach
2010-08-17  6:47         ` Sascha Hauer
2010-08-17  6:47           ` Sascha Hauer
2010-08-18  3:49           ` Alexei Babich
2010-08-18  4:41             ` Baruch Siach
2010-08-18 11:17           ` Philippe Rétornaz
2010-08-18 11:17             ` Philippe Rétornaz
2010-08-24  7:10     ` [PATCH 3/3 v3] " Sascha Hauer
2010-08-24  7:10       ` Sascha Hauer
2010-09-02 14:06     ` [PATCH 3/3] " Russell King - ARM Linux
2010-09-02 14:06       ` Russell King - ARM Linux
2010-08-23 12:57   ` [PATCH 3/3 v2] " Sascha Hauer
2010-08-23 12:57     ` Sascha Hauer
2010-08-23 17:30     ` Linus Walleij
2010-08-23 17:30       ` Linus Walleij
2010-08-24  6:58       ` Sascha Hauer
2010-08-24  6:58         ` Sascha Hauer
2010-08-23 17:48     ` Uwe Kleine-König
2010-08-23 17:48       ` Uwe Kleine-König
2010-08-28 15:18       ` Linus Walleij
2010-08-28 15:18         ` Linus Walleij
2010-08-28 15:27         ` Marek Vasut
2010-08-28 15:27           ` Marek Vasut
2010-08-28 16:18           ` Sascha Hauer
2010-08-28 16:18             ` Sascha Hauer
2010-08-28 16:30             ` Marek Vasut
2010-08-28 16:30               ` Marek Vasut
2010-08-28 17:20               ` Sascha Hauer
2010-08-28 17:20                 ` Sascha Hauer
2010-09-02 11:20               ` Russell King - ARM Linux
2010-09-02 11:20                 ` Russell King - ARM Linux
2010-08-29 12:35             ` Linus Walleij
2010-08-29 12:35               ` Linus Walleij
2010-08-30 12:55               ` Sascha Hauer
2010-08-30 12:55                 ` Sascha Hauer
2010-08-24  7:58     ` Lothar Waßmann
2010-08-24  7:58       ` Lothar Waßmann
2010-08-24 15:01       ` Linus Walleij
2010-08-24 15:01         ` Linus Walleij
2010-08-27 12:22   ` [PATCH 3/3 v3] " Sascha Hauer
2010-08-27 12:22     ` Sascha Hauer
2010-08-29 21:46     ` Marc Reilly

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100924072523.GM23406@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=dan.j.williams@intel.com \
    --cc=linus.ml.walleij@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.