linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: vinod.koul@intel.com (Vinod Koul)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 6/9] crypto: ux500/cryp - Set DMA configuration though dma_slave_config()
Date: Fri, 26 Apr 2013 13:46:46 +0530	[thread overview]
Message-ID: <20130426081646.GD24632@intel.com> (raw)
In-Reply-To: <CACRpkdaBf++gy3sghC-t33uio2+eHp1MrQ2FM0XXBazZTtm3kA@mail.gmail.com>

On Fri, Apr 26, 2013 at 10:28:39AM +0200, Linus Walleij wrote:
> On Thu, Apr 25, 2013 at 4:11 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> 
> > The dma engine driver must know the address in its dma space, while the
> > slave driver has it available in physical space. These two are often the
> > same, but there is no generic way to convert between the two, especially
> > if the dma engine resides behind an IOMMU.
> >
> > The best assumption we can make is that the dma engine driver knows
> > how to convert between the two. Interestingly the documentation for
> > dma_slave_config talks about "physical address", while the structure
> > itself uses a dma_addr_t. Linus Walleij introduced the structure in
> > c156d0a5b0 "DMAENGINE: generic slave channel control v3", so I assume
> > he can shed some light on what he was thinking. I assume the documentation
> > is right but the structure is not and should be converted to use
> > phys_add_t or resource_size_t.
> 
> OK I could cook a patch for that, but I think I need some input from
> Vinod and/or Russell on this.
the dma_slave_config is physical address that should be passed directly to the
controller. Obviosuly it should phys_addr_t :)

The mapping & unmapping of dma buffer (memcpy and memory buffer in this txn) is
required to be performed by the client driver. The dmanegine or dmaengine driver
will not do that for you...

This is true for slave usage and not for async case.
> 
> It does make sense to me that if anything knows how to map a physical
> address into the DMA address space it'll be the DMA engine.
> 
> However this rings a bell that there may be a possible relation to
> DMA-API, since that API syncs memory buffers to the DMA
> address space if there is some MMU inbetween the DMA and the
> (ordinary, non-device) memory.
> 
> So if we think one step ahead, assuming the DMAC is actually behind
> an MMU making it see the device in some other address than the
> physical (bus) space, where would the address be resolved?
> 
> Yours,
> Linus Walleij

  reply	other threads:[~2013-04-26  8:16 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-18 10:26 [PATCH 0/9] Fix ux500 crypto drivers and init DMA in the correct way Lee Jones
2013-04-18 10:26 ` [PATCH 1/9] crypto: ux500/hash - Prepare clock before enabling it Lee Jones
2013-04-19 12:24   ` [PATCH 1/9 v2] " Lee Jones
2013-04-19 12:26     ` Arnd Bergmann
2013-04-25 11:49     ` Linus Walleij
2013-04-25 13:46       ` Lee Jones
2013-04-18 10:26 ` [PATCH 2/9] crypto: ux500/hash - Set DMA configuration though dma_slave_config() Lee Jones
2013-04-25 11:55   ` Linus Walleij
2013-04-18 10:26 ` [PATCH 3/9] ARM: ux500: Stop passing Hash DMA channel config information though pdata Lee Jones
2013-04-25 11:56   ` Linus Walleij
2013-04-18 10:27 ` [PATCH 4/9] crypto: ux500/cryp - Prepare clock before enabling it Lee Jones
2013-04-19 12:22   ` [PATCH 4/9 v2] " Lee Jones
2013-04-19 12:23     ` Arnd Bergmann
2013-04-25 11:57     ` Linus Walleij
2013-04-18 10:27 ` [PATCH 5/9] crypto: ux500/cryp - Fix compile error Lee Jones
2013-04-25 12:00   ` Linus Walleij
2013-04-25 13:44     ` Lee Jones
2013-04-18 10:27 ` [PATCH 6/9] crypto: ux500/cryp - Set DMA configuration though dma_slave_config() Lee Jones
2013-04-25 12:02   ` Linus Walleij
2013-04-25 13:44     ` Lee Jones
2013-04-25 14:05       ` Linus Walleij
2013-04-25 14:11       ` Arnd Bergmann
2013-04-26  8:28         ` Linus Walleij
2013-04-26  8:16           ` Vinod Koul [this message]
2013-04-26  9:07             ` Linus Walleij
2013-04-26  9:39             ` Arnd Bergmann
2013-04-26  9:44               ` Russell King - ARM Linux
2013-04-26  9:41             ` Russell King - ARM Linux
2013-04-30 10:08               ` Vinod Koul
2013-04-26  9:34           ` Arnd Bergmann
2013-04-18 10:27 ` [PATCH 7/9] ARM: ux500: Stop passing Cryp DMA channel config information though pdata Lee Jones
2013-04-25 12:02   ` Linus Walleij
2013-04-18 10:27 ` [PATCH 8/9] crypto: ux500/[cryp|hash] - Show successful start-up in the bootlog Lee Jones
2013-04-25 12:03   ` Linus Walleij
2013-04-18 10:27 ` [PATCH 9/9] ARM: ux500: Register Cyrp and Hash platform drivers on Snowball Lee Jones
2013-04-25 12:04   ` Linus Walleij
2013-04-18 10:44 ` [PATCH 0/9] Fix ux500 crypto drivers and init DMA in the correct way Arnd Bergmann

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=20130426081646.GD24632@intel.com \
    --to=vinod.koul@intel.com \
    --cc=linux-arm-kernel@lists.infradead.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 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).