linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vinod Koul <vinod.koul@intel.com>
To: "Bounine, Alexandre" <Alexandre.Bounine@idt.com>,
	Russell King <rmk@arm.linux.org.uk>
Cc: dan.j.williams@intel.com, linux-kernel@vger.kernel.org,
	akpm@linux-foundation.org,
	Jassi Brar <jaswinder.singh@linaro.org>,
	Kumar Gala <galak@kernel.crashing.org>,
	Matt Porter <mporter@kernel.crashing.org>,
	Li Yang <leoli@freescale.com>
Subject: RE: [PATCH 01/11] dmaengine: add context parameter toprep_slave_sg and prep_dma_cyclic
Date: Mon, 06 Feb 2012 17:23:02 +0530	[thread overview]
Message-ID: <1328529182.26182.92.camel@vkoul-udesk3> (raw)
In-Reply-To: <0CE8B6BE3C4AD74AB97D9D29BD24E55202872683@CORPEXCH1.na.ads.idt.com>

On Fri, 2012-02-03 at 07:31 -0800, Bounine, Alexandre wrote:
> On Thu, Feb 02, 2012 at 4:44 PM, Russell King wrote:
> > 
> > On Thu, Feb 02, 2012 at 04:32:11PM -0500, Alexandre Bounine wrote:
> > > Add context parameter to device_prep_slave_sg() and
> device_prep_dma_cyclic()
> > > interfaces to allow passing client/target specific information
> associated
> > > with the data transfer.
> > 
> > I'm slightly concerned about having this as a vague 'void *' pointer.
> > What that means is that the data being passed through it is entirely
> > unspecified, and quite specific to the DMA engine.
> > 
> > That's rather worrying when we (on ARM) are moving towards a model
> > where the same peripheral IP can be backed by multiple different DMA
> > engines.  We already have peripheral drivers (clients of DMA engine)
> > which can be attached to completely different DMA engine drivers.
Russell,
Agreed but the problem with new models like RIO, MSM is that they seem
to have some different parameters they depend on, apart from the usual
ones we have. And these are per transfer dependent rather than channel
dependent as we have. So we need some way to pass arch specfic
parameters... so a agenric mechanism this was proposed...
Agreed, this has its own shortcoming. If you have a better way, please
let us know :)

> > 
> > If DMA engines continue to operate conventionally with this parameter
> > NULL then that's fine for current stuff.  I would suggest that it's
> > made to be something a little better defined though, as the 'void *'
> > approach encourages each driver writer to invent their own way to
> > specify, eg, an interleaved transfer.  We'll then end up with N
> > different ways to specify the same thing.
> > 
> > Not only that, but peripheral drivers won't know what kind of data to
> > pass there (they would have to have additional knowledge of the DMA
> > engine which they're attached to.)
> > 
> > Basically, allowing a DMA engine specific blob of data to be passed
> > destroys the idea of having a consistent API for peripheral drivers
> > to use, because they can then no longer be independent of their DMA
> > engine.
> > 
> I agree with your concern about "void *" being quite wide-open
> definition.
> But it may be practically impossible to come up with better definition
> that may be equally suitable for different systems or HW combinations
> (e.g. definition that is good for ARM peripherals may not fit into the
> RapidIO model).
> 
> Some level of protection should be expected from filter callbacks
> invoked
> by dma_request_channel(). This way, for example, RapidIO client will not
> acquire DMA channel which does not support RapidIO data transfers. 
>  
> After saying all above to defend the changes, I have to admit that your
> comment made me to look harder for an alternative way to pass
> per-transfer
> parameter. As a result, I am considering a new idea when per-transfer
> configuration data will be passed as the first element of the scatter
> list.
> Something like a packet header data but it will be used to setup
> buffer descriptors instead of being part of data stream.
Alexandre,
dmac gets physical address, so you would need to remap that again to be
able to parse these buffers... Sorry I dont like this idea at all.
> 
> This new approach will preserve existing DMA engine interface and be
> easier
> for backporting of RapidIO drivers. Yes, there is a system dependency in
> scatter
> list format but it is completely protected by channel filtering
> mechanism.   
> 
> Because of that it may be a good idea to consider this set of patches
> being "on hold" unless there are other parties interested in proposed
> interface changes.


-- 
~Vinod


  reply	other threads:[~2012-02-06 11:51 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-02 21:32 [PATCH 00/11] dmaengine: add context parameter to prep_slave_sg and prep_dma_cyclic Alexandre Bounine
2012-02-02 21:32 ` [PATCH 01/11] " Alexandre Bounine
2012-02-02 21:43   ` Russell King
2012-02-03 15:31     ` [PATCH 01/11] dmaengine: add context parameter toprep_slave_sg " Bounine, Alexandre
2012-02-06 11:53       ` Vinod Koul [this message]
2012-02-06 15:04         ` Bounine, Alexandre
2012-02-06 15:28           ` Vinod Koul
2012-02-06 15:53             ` Russell King
2012-02-06 17:02               ` [PATCH 01/11] dmaengine: add context parameter toprep_slave_sgand prep_dma_cyclic Bounine, Alexandre
2012-02-06 18:07                 ` Vinod Koul
2012-02-06 18:45                   ` Bounine, Alexandre
2012-02-07  3:39                     ` Vinod Koul
2012-02-07 14:01                       ` Bounine, Alexandre
2012-02-07 14:14                         ` Vinod Koul
2012-02-07 14:19                           ` Bounine, Alexandre
2012-02-06 18:04               ` [PATCH 01/11] dmaengine: add context parameter toprep_slave_sg and prep_dma_cyclic Vinod Koul
2012-02-06 15:56             ` Bounine, Alexandre
2012-02-06 16:16               ` Russell King
2012-02-02 21:32 ` [PATCH 02/11] dmaengine/drivers: add context parameter for DMA_SLAVE and DMA_CYCLIC Alexandre Bounine
2012-02-02 21:32 ` [PATCH 03/11] plat-samsung: " Alexandre Bounine
2012-02-02 21:32 ` [PATCH 04/11] media/video: add new context parameter for DMA_SLAVE calls Alexandre Bounine
2012-02-02 21:32 ` [PATCH 05/11] mmc/host: add context parameter for DMA_SLAVE and DMA_CYCLIC Alexandre Bounine
2012-02-03  9:20   ` Ulf Hansson
2012-02-03 16:52     ` Bounine, Alexandre
2012-02-03 17:01       ` Russell King
2012-02-03 18:36         ` [PATCH 05/11] mmc/host: add context parameter for DMA_SLAVEand DMA_CYCLIC Bounine, Alexandre
2012-02-02 21:32 ` [PATCH 06/11] nand/gpmi: add context parameter to prep_slave_sg calls Alexandre Bounine
2012-02-02 22:13   ` Marek Vasut
2012-02-03 16:35     ` Bounine, Alexandre
2012-02-02 21:32 ` [PATCH 07/11] net/ks8842: add context parameter to prep_slave_sg call Alexandre Bounine
2012-02-02 21:32 ` [PATCH 08/11] spi/serial: add context parameter for DMA_SLAVE and DMA_CYCLIC Alexandre Bounine
2012-02-02 21:32 ` [PATCH 09/11] usb/musb: add context parameter to prep_slave_sg call Alexandre Bounine
2012-02-02 21:32 ` [PATCH 10/11] usb/renesas: " Alexandre Bounine
2012-02-02 21:32 ` [PATCH 11/11] sound/soc: add context parameter to prep_slave_sg and prep_dma_cyclic calls Alexandre Bounine
2012-02-02 22:22   ` Mark Brown
2012-02-03 16:41     ` Bounine, Alexandre

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=1328529182.26182.92.camel@vkoul-udesk3 \
    --to=vinod.koul@intel.com \
    --cc=Alexandre.Bounine@idt.com \
    --cc=akpm@linux-foundation.org \
    --cc=dan.j.williams@intel.com \
    --cc=galak@kernel.crashing.org \
    --cc=jaswinder.singh@linaro.org \
    --cc=leoli@freescale.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mporter@kernel.crashing.org \
    --cc=rmk@arm.linux.org.uk \
    /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 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).