All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>
To: Matt Porter <mporter-l0cyMroinI0@public.gmane.org>
Cc: Linux DaVinci Kernel List
	<davinci-linux-open-source-VycZQUHpC/PFrsHnngEfi1aTQe2KTcn/@public.gmane.org>,
	Linux OMAP List
	<linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Russell King <linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org>,
	Linux Documentation List
	<linux-doc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Linux MMC List
	<linux-mmc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Devicetree Discuss
	<devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org>,
	Mark Brown
	<broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>,
	Sekhar Nori <nsekhar-l0cyMroinI0@public.gmane.org>,
	Linux Kernel Mailing List
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Rob Herring <rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org>,
	Vinod Koul <vinod.koul-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
	Dan Williams <djbw-b10kYP2dOMg@public.gmane.org>,
	Linux SPI Devel List
	<spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>,
	Chris Ball <cjb-2X9k7bc8m7Mdnm+yROfE0A@public.gmane.org>,
	Linux ARM Kernel List
	<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>
Subject: Re: [PATCH v6 07/10] dmaengine: add dma_request_slave_channel_compat()
Date: Wed, 30 Jan 2013 09:27:18 +0000	[thread overview]
Message-ID: <201301300927.18509.arnd@arndb.de> (raw)
In-Reply-To: <1359529229-22207-8-git-send-email-mporter-l0cyMroinI0@public.gmane.org>

On Wednesday 30 January 2013, Matt Porter wrote:
> Adds a dma_request_slave_channel_compat() wrapper which accepts
> both the arguments from dma_request_channel() and
> dma_request_slave_channel(). Based on whether the driver is
> instantiated via DT, the appropriate channel request call will be
> made.
> 
> This allows for a much cleaner migration of drivers to the
> dmaengine DT API as platforms continue to be mixed between those
> that boot using DT and those that do not.
> 
> Suggested-by: Tony Lindgren <tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
> Signed-off-by: Matt Porter <mporter-l0cyMroinI0@public.gmane.org>
> Acked-by: Tony Lindgren <tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>

Acked-by: Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>

> @@ -1001,6 +1001,22 @@ void dma_run_dependencies(struct dma_async_tx_descriptor *tx);
>  struct dma_chan *dma_find_channel(enum dma_transaction_type tx_type);
>  struct dma_chan *net_dma_find_channel(void);
>  #define dma_request_channel(mask, x, y) __dma_request_channel(&(mask), x, y)
> +#define dma_request_slave_channel_compat(mask, x, y, dev, name) \
> +	__dma_request_slave_channel_compat(&(mask), x, y, dev, name)
> +
> +static inline struct dma_chan
> +*__dma_request_slave_channel_compat(dma_cap_mask_t *mask, dma_filter_fn fn,
> +				  void *fn_param, struct device *dev,
> +				  char *name)
> +{
> +	struct dma_chan *chan;
> +
> +	chan = dma_request_slave_channel(dev, name);
> +	if (chan)
> +		return chan;
> +
> +	return __dma_request_channel(mask, fn, fn_param);
> +}

After I have spent some more time with implementing the code for dw_dma,
I think the mask is actually unnecessary here, the helper could just
always set it to DMA_SLAVE before calling __dma_request_channel.

It's not a bug to do it this way though, and it may help convert drivers
a little easier if there is less to change.

	Arnd

WARNING: multiple messages have this Message-ID (diff)
From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v6 07/10] dmaengine: add dma_request_slave_channel_compat()
Date: Wed, 30 Jan 2013 09:27:18 +0000	[thread overview]
Message-ID: <201301300927.18509.arnd@arndb.de> (raw)
In-Reply-To: <1359529229-22207-8-git-send-email-mporter@ti.com>

On Wednesday 30 January 2013, Matt Porter wrote:
> Adds a dma_request_slave_channel_compat() wrapper which accepts
> both the arguments from dma_request_channel() and
> dma_request_slave_channel(). Based on whether the driver is
> instantiated via DT, the appropriate channel request call will be
> made.
> 
> This allows for a much cleaner migration of drivers to the
> dmaengine DT API as platforms continue to be mixed between those
> that boot using DT and those that do not.
> 
> Suggested-by: Tony Lindgren <tony@atomide.com>
> Signed-off-by: Matt Porter <mporter@ti.com>
> Acked-by: Tony Lindgren <tony@atomide.com>

Acked-by: Arnd Bergmann <arnd@arndb.de>

> @@ -1001,6 +1001,22 @@ void dma_run_dependencies(struct dma_async_tx_descriptor *tx);
>  struct dma_chan *dma_find_channel(enum dma_transaction_type tx_type);
>  struct dma_chan *net_dma_find_channel(void);
>  #define dma_request_channel(mask, x, y) __dma_request_channel(&(mask), x, y)
> +#define dma_request_slave_channel_compat(mask, x, y, dev, name) \
> +	__dma_request_slave_channel_compat(&(mask), x, y, dev, name)
> +
> +static inline struct dma_chan
> +*__dma_request_slave_channel_compat(dma_cap_mask_t *mask, dma_filter_fn fn,
> +				  void *fn_param, struct device *dev,
> +				  char *name)
> +{
> +	struct dma_chan *chan;
> +
> +	chan = dma_request_slave_channel(dev, name);
> +	if (chan)
> +		return chan;
> +
> +	return __dma_request_channel(mask, fn, fn_param);
> +}

After I have spent some more time with implementing the code for dw_dma,
I think the mask is actually unnecessary here, the helper could just
always set it to DMA_SLAVE before calling __dma_request_channel.

It's not a bug to do it this way though, and it may help convert drivers
a little easier if there is less to change.

	Arnd

WARNING: multiple messages have this Message-ID (diff)
From: Arnd Bergmann <arnd@arndb.de>
To: Matt Porter <mporter@ti.com>
Cc: Tony Lindgren <tony@atomide.com>, Sekhar Nori <nsekhar@ti.com>,
	Grant Likely <grant.likely@secretlab.ca>,
	Mark Brown <broonie@opensource.wolfsonmicro.com>,
	Benoit Cousson <b-cousson@ti.com>,
	Russell King <linux@arm.linux.org.uk>,
	Vinod Koul <vinod.koul@intel.com>, Rob Landley <rob@landley.net>,
	Chris Ball <cjb@laptop.org>,
	Devicetree Discuss <devicetree-discuss@lists.ozlabs.org>,
	Linux OMAP List <linux-omap@vger.kernel.org>,
	Linux ARM Kernel List <linux-arm-kernel@lists.infradead.org>,
	Linux DaVinci Kernel List 
	<davinci-linux-open-source@linux.davincidsp.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linux Documentation List <linux-doc@vger.kernel.org>,
	Linux MMC List <linux-mmc@vger.kernel.org>,
	Linux SPI Devel List  <spi-devel-general@lists.sourceforge.net>,
	Dan Williams <djbw@fb.com>, Rob Herring <rob.herring@calxeda.com>
Subject: Re: [PATCH v6 07/10] dmaengine: add dma_request_slave_channel_compat()
Date: Wed, 30 Jan 2013 09:27:18 +0000	[thread overview]
Message-ID: <201301300927.18509.arnd@arndb.de> (raw)
In-Reply-To: <1359529229-22207-8-git-send-email-mporter@ti.com>

On Wednesday 30 January 2013, Matt Porter wrote:
> Adds a dma_request_slave_channel_compat() wrapper which accepts
> both the arguments from dma_request_channel() and
> dma_request_slave_channel(). Based on whether the driver is
> instantiated via DT, the appropriate channel request call will be
> made.
> 
> This allows for a much cleaner migration of drivers to the
> dmaengine DT API as platforms continue to be mixed between those
> that boot using DT and those that do not.
> 
> Suggested-by: Tony Lindgren <tony@atomide.com>
> Signed-off-by: Matt Porter <mporter@ti.com>
> Acked-by: Tony Lindgren <tony@atomide.com>

Acked-by: Arnd Bergmann <arnd@arndb.de>

> @@ -1001,6 +1001,22 @@ void dma_run_dependencies(struct dma_async_tx_descriptor *tx);
>  struct dma_chan *dma_find_channel(enum dma_transaction_type tx_type);
>  struct dma_chan *net_dma_find_channel(void);
>  #define dma_request_channel(mask, x, y) __dma_request_channel(&(mask), x, y)
> +#define dma_request_slave_channel_compat(mask, x, y, dev, name) \
> +	__dma_request_slave_channel_compat(&(mask), x, y, dev, name)
> +
> +static inline struct dma_chan
> +*__dma_request_slave_channel_compat(dma_cap_mask_t *mask, dma_filter_fn fn,
> +				  void *fn_param, struct device *dev,
> +				  char *name)
> +{
> +	struct dma_chan *chan;
> +
> +	chan = dma_request_slave_channel(dev, name);
> +	if (chan)
> +		return chan;
> +
> +	return __dma_request_channel(mask, fn, fn_param);
> +}

After I have spent some more time with implementing the code for dw_dma,
I think the mask is actually unnecessary here, the helper could just
always set it to DMA_SLAVE before calling __dma_request_channel.

It's not a bug to do it this way though, and it may help convert drivers
a little easier if there is less to change.

	Arnd

  parent reply	other threads:[~2013-01-30  9:27 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-30  7:00 [PATCH v6 00/10] DMA Engine support for AM33XX Matt Porter
2013-01-30  7:00 ` Matt Porter
2013-01-30  7:00 ` [PATCH v6 02/10] ARM: edma: remove unused transfer controller handlers Matt Porter
2013-01-30  7:00   ` Matt Porter
     [not found] ` <1359529229-22207-1-git-send-email-mporter-l0cyMroinI0@public.gmane.org>
2013-01-30  7:00   ` [PATCH v6 01/10] ARM: davinci: move private EDMA API to arm/common Matt Porter
2013-01-30  7:00     ` Matt Porter
2013-01-30  7:00     ` Matt Porter
2013-01-30  7:00   ` [PATCH v6 03/10] ARM: edma: add AM33XX support to the private EDMA API Matt Porter
2013-01-30  7:00     ` Matt Porter
2013-01-30  7:00     ` Matt Porter
     [not found]     ` <1359529229-22207-4-git-send-email-mporter-l0cyMroinI0@public.gmane.org>
2013-01-30  9:32       ` Arnd Bergmann
2013-01-30  9:32         ` Arnd Bergmann
2013-01-30  9:32         ` Arnd Bergmann
2013-01-31 18:32         ` Matt Porter
2013-01-31 18:32           ` Matt Porter
2013-01-31 20:58           ` Arnd Bergmann
2013-01-31 20:58             ` Arnd Bergmann
     [not found]           ` <6932828d68394f71ba6df8e6bf608635@DFLE72.ent.ti.com>
2013-01-31 21:42             ` Matt Porter
2013-01-31 21:42               ` Matt Porter
2013-02-01  6:01               ` Luciano Coelho
2013-02-01  6:01                 ` Luciano Coelho
2013-02-01  6:01                 ` Luciano Coelho
2013-02-01 11:57                 ` Matt Porter
2013-02-01 11:57                   ` Matt Porter
2013-02-01 11:57                   ` Matt Porter
2013-02-01 11:57                   ` Matt Porter
2013-01-30  7:00   ` [PATCH v6 04/10] dmaengine: edma: enable build for AM33XX Matt Porter
2013-01-30  7:00     ` Matt Porter
2013-01-30  7:00     ` Matt Porter
2013-01-30  7:00   ` [PATCH v6 05/10] dmaengine: edma: Add TI EDMA device tree binding Matt Porter
2013-01-30  7:00     ` Matt Porter
2013-01-30  7:00     ` Matt Porter
2013-01-30  7:00   ` [PATCH v6 06/10] ARM: dts: add AM33XX EDMA support Matt Porter
2013-01-30  7:00     ` Matt Porter
2013-01-30  7:00     ` Matt Porter
2013-01-30  7:00   ` [PATCH v6 08/10] spi: omap2-mcspi: convert to dma_request_slave_channel_compat() Matt Porter
2013-01-30  7:00     ` Matt Porter
2013-01-30  7:00     ` Matt Porter
     [not found]     ` <1359529229-22207-9-git-send-email-mporter-l0cyMroinI0@public.gmane.org>
2013-01-30 10:35       ` Mark Brown
2013-01-30 10:35         ` Mark Brown
2013-01-30 10:35         ` Mark Brown
2013-01-30  7:00   ` [PATCH v6 09/10] spi: omap2-mcspi: add generic DMA request support to the DT binding Matt Porter
2013-01-30  7:00     ` Matt Porter
2013-01-30  7:00     ` Matt Porter
     [not found]     ` <1359529229-22207-10-git-send-email-mporter-l0cyMroinI0@public.gmane.org>
2013-01-30  9:24       ` Arnd Bergmann
2013-01-30  9:24         ` Arnd Bergmann
2013-01-30  9:24         ` Arnd Bergmann
2013-01-31  1:32         ` Matt Porter
2013-01-31  1:32           ` Matt Porter
2013-01-30  7:00   ` [PATCH v6 10/10] ARM: dts: add AM33XX SPI DMA support Matt Porter
2013-01-30  7:00     ` Matt Porter
2013-01-30  7:00     ` Matt Porter
2013-01-30  7:00 ` [PATCH v6 07/10] dmaengine: add dma_request_slave_channel_compat() Matt Porter
2013-01-30  7:00   ` Matt Porter
     [not found]   ` <1359529229-22207-8-git-send-email-mporter-l0cyMroinI0@public.gmane.org>
2013-01-30  9:27     ` Arnd Bergmann [this message]
2013-01-30  9:27       ` Arnd Bergmann
2013-01-30  9:27       ` Arnd Bergmann
     [not found]   ` <ee89773ba46d44da945eee7b07ab1dc4@DFLE73.ent.ti.com>
2013-01-31  1:38     ` Matt Porter
2013-01-31  1:38       ` Matt Porter

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=201301300927.18509.arnd@arndb.de \
    --to=arnd-r2ngtmty4d4@public.gmane.org \
    --cc=broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org \
    --cc=cjb-2X9k7bc8m7Mdnm+yROfE0A@public.gmane.org \
    --cc=davinci-linux-open-source-VycZQUHpC/PFrsHnngEfi1aTQe2KTcn/@public.gmane.org \
    --cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
    --cc=djbw-b10kYP2dOMg@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-doc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org \
    --cc=linux-mmc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mporter-l0cyMroinI0@public.gmane.org \
    --cc=nsekhar-l0cyMroinI0@public.gmane.org \
    --cc=rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org \
    --cc=spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    --cc=vinod.koul-ral2JQCrhuEAvxtiuMwx3w@public.gmane.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.