linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Maxime Ripard <maxime.ripard@free-electrons.com>
To: Lars-Peter Clausen <lars@metafoo.de>
Cc: "Vinod Koul" <vinod.koul@intel.com>,
	"Dan Williams" <dan.j.williams@intel.com>,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, dmaengine@vger.kernel.org,
	"Russell King" <linux@arm.linux.org.uk>,
	"Arnd Bergmann" <arnd@arndb.de>,
	"Antoine Ténart" <antoine@free-electrons.com>,
	"Thomas Petazzoni" <thomas@free-electrons.com>,
	"Alexandre Belloni" <alexandre.belloni@free-electrons.com>,
	"Boris Brezillon" <boris@free-electrons.com>,
	"Matt Porter" <matt.porter@linaro.org>,
	laurent.pinchart@ideasonboard.com, ludovic.desroches@atmel.com,
	"Gregory Clement" <gregory.clement@free-electrons.com>,
	"Nicolas Ferre" <nicolas.ferre@atmel.com>
Subject: Re: [PATCH] Documentation: dmaengine: Add a documentation for the dma controller API
Date: Thu, 31 Jul 2014 18:13:31 +0200	[thread overview]
Message-ID: <20140731161331.GD3952@lukather> (raw)
In-Reply-To: <53DA3A48.8070900@metafoo.de>

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

Hi Lars-Peter,

On Thu, Jul 31, 2014 at 02:44:56PM +0200, Lars-Peter Clausen wrote:
> On 07/31/2014 09:44 AM, Maxime Ripard wrote:
> [...]
> >   - Having to set device_slave_caps or not?
> 
> Yes. This should in my opinion be mandatory for new drivers.

Ok. 

> One of the issues with the DMAengine API is that it is really hard
> to write generic drivers that do not already know about the
> capabilities of the DMA controller. E.g. if you have a peripheral
> that is used on SoC A it assumes that the DMA controller it is
> connected to has the capabilities of the DMA controller in SoC A. If
> the same peripheral is now used on SoC B with a DMA controller with
> different capabilities this often ends up with ugly ifdefery in the
> peripheral driver. The peripheral driver shouldn't have to know
> which specific DMA controller it is connected to (It's a bit as if a
> GPIO consumer needed to know which GPIO controller is connected
> to). We got away with the current approach since there is not that
> much diversity in the mixing of peripherals and DMA controllers
> (each vendor pretty has their own DMA controller which it uses for
> their own peripherals). But with more recent code consolidation we
> are on a path to generic DMA support within subsystem frameworks
> (there is generic DMA support for audio, there is generic DMA
> support for SPI and I also have a (currently) out of tree patch for
> generic DMA support for IIO). Also these generic drivers need to be
> able to discover the capabilities of the DMA controller to be able
> to make the right decisions.

Yeah, I've seen the generic infrastructure in both ASoC and SPI, and
it's great that it's coming to IIO as well.

I wasn't aware that it was relying on device_slave_caps though, and
been mislead by the caps name into thinking that it was related to the
caps_mask, which is obviously not.

From what you're saying, and judging from the drivers that already
implement it, can't it be moved directly to the framework itself ?

The informations put there could be either used elsewhere (like
framework-level filtering of invalid directions/bus width) or could be
derived directly from which callbacks are set (in the pause/terminate
case)?

I guess that would make generic layer much easier to write, since
you'll always have this information.

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  reply	other threads:[~2014-07-31 16:27 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-30 16:03 [PATCH] Documentation: dmaengine: Add a documentation for the dma controller API Maxime Ripard
2014-07-30 16:06 ` Vinod Koul
2014-07-31  7:44   ` Maxime Ripard
2014-07-31 11:56     ` Vinod Koul
2014-07-31 16:23       ` Maxime Ripard
2014-08-01 17:13         ` Vinod Koul
2014-08-02 14:49           ` Maxime Ripard
2014-08-02 15:17             ` Russell King - ARM Linux
2014-08-02 19:06               ` Maxime Ripard
2014-08-05 16:25             ` Vinod Koul
2014-07-31 12:44     ` Lars-Peter Clausen
2014-07-31 16:13       ` Maxime Ripard [this message]
2014-07-31 16:54         ` Lars-Peter Clausen
2014-07-31 17:37           ` Maxime Ripard
2014-08-01  8:00             ` Lars-Peter Clausen
2014-08-01  8:57               ` Maxime Ripard
2014-08-01 17:15                 ` Vinod Koul
2014-08-01 18:09                   ` Lars-Peter Clausen
2014-08-02 15:13                     ` Maxime Ripard
2014-08-04  7:16                       ` Lars-Peter Clausen
2014-07-31 13:22     ` Russell King - ARM Linux
2014-07-31 16:41       ` Maxime Ripard
2014-08-01 14:53         ` Russell King - ARM Linux
2014-08-02 15:11           ` Maxime Ripard
2014-08-02 15:29             ` Russell King - ARM Linux
2014-08-02 19:05               ` Maxime Ripard
2014-08-01 17:22       ` Vinod Koul
2014-08-05  8:16 ` Geert Uytterhoeven
2014-08-14  8:53 ` Ludovic Desroches
2014-08-14  8:57   ` Russell King - ARM Linux
2014-08-19 13:45     ` Vinod Koul
2014-08-19 14:44       ` Russell King - ARM Linux
2014-08-19 14:57         ` Vinod Koul

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=20140731161331.GD3952@lukather \
    --to=maxime.ripard@free-electrons.com \
    --cc=alexandre.belloni@free-electrons.com \
    --cc=antoine@free-electrons.com \
    --cc=arnd@arndb.de \
    --cc=boris@free-electrons.com \
    --cc=dan.j.williams@intel.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=gregory.clement@free-electrons.com \
    --cc=lars@metafoo.de \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=ludovic.desroches@atmel.com \
    --cc=matt.porter@linaro.org \
    --cc=nicolas.ferre@atmel.com \
    --cc=thomas@free-electrons.com \
    --cc=vinod.koul@intel.com \
    /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).