From: Vinod Koul <vinod.koul@intel.com>
To: Russell King - ARM Linux <linux@arm.linux.org.uk>
Cc: Linus Walleij <linus.walleij@linaro.org>,
Arnd Bergmann <arnd@arndb.de>, Lee Jones <lee.jones@linaro.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Linus WALLEIJ <linus.walleij@stericsson.com>,
Herbert Xu <herbert@gondor.hengli.com.au>,
"David S. Miller" <davem@davemloft.net>,
Andreas Westin <andreas.westin@stericsson.com>,
"linux-crypto@vger.kernel.org" <linux-crypto@vger.kernel.org>,
magnus.p.persson@stericsson.com
Subject: Re: [PATCH 6/9] crypto: ux500/cryp - Set DMA configuration though dma_slave_config()
Date: Tue, 30 Apr 2013 15:38:37 +0530 [thread overview]
Message-ID: <20130430100837.GB1960@intel.com> (raw)
In-Reply-To: <20130426094123.GG14496@n2100.arm.linux.org.uk>
On Fri, Apr 26, 2013 at 10:41:23AM +0100, Russell King - ARM Linux wrote:
> On Fri, Apr 26, 2013 at 01:46:46PM +0530, Vinod Koul wrote:
> > 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 :)
>
> What you've just said is actually confusing.
>
> "physical address" is normally the term used to describe the addresses
> seen to the RAM. phys_addr_t describes this. This is not necessarily
> what needs to be programmed into the DMA controller.
Yes that would be true when you have MMU
>
> For RAM addresses, they must be mapped via the DMA API - and this gives
> you a dma_addr_t.
>
> "DMA address" is the address to be programmed into a DMA controller to
> access a particular address in RAM or device, and has type dma_addr_t.
> When you're programming a DMA controller to access a device, you are
> clearly telling it the address on the _DMA controller's bus_ to access
> that register, which may or may not be the same as the physical address.
>
> There are platforms in existence where phys_addr_t can be 32-bit but
> dma_addr_t can be 64-bit. Getting this stuff wrong can cause problems.
Sure, thanks for pointing, so we wont do this change.
--
~Vinod
WARNING: multiple messages have this Message-ID (diff)
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: Tue, 30 Apr 2013 15:38:37 +0530 [thread overview]
Message-ID: <20130430100837.GB1960@intel.com> (raw)
In-Reply-To: <20130426094123.GG14496@n2100.arm.linux.org.uk>
On Fri, Apr 26, 2013 at 10:41:23AM +0100, Russell King - ARM Linux wrote:
> On Fri, Apr 26, 2013 at 01:46:46PM +0530, Vinod Koul wrote:
> > 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 :)
>
> What you've just said is actually confusing.
>
> "physical address" is normally the term used to describe the addresses
> seen to the RAM. phys_addr_t describes this. This is not necessarily
> what needs to be programmed into the DMA controller.
Yes that would be true when you have MMU
>
> For RAM addresses, they must be mapped via the DMA API - and this gives
> you a dma_addr_t.
>
> "DMA address" is the address to be programmed into a DMA controller to
> access a particular address in RAM or device, and has type dma_addr_t.
> When you're programming a DMA controller to access a device, you are
> clearly telling it the address on the _DMA controller's bus_ to access
> that register, which may or may not be the same as the physical address.
>
> There are platforms in existence where phys_addr_t can be 32-bit but
> dma_addr_t can be 64-bit. Getting this stuff wrong can cause problems.
Sure, thanks for pointing, so we wont do this change.
--
~Vinod
next prev parent reply other threads:[~2013-04-30 10:41 UTC|newest]
Thread overview: 98+ 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 ` Lee Jones
2013-04-18 10:26 ` [PATCH 1/9] crypto: ux500/hash - Prepare clock before enabling it Lee Jones
2013-04-18 10:26 ` Lee Jones
2013-04-18 10:26 ` Lee Jones
2013-04-19 12:24 ` [PATCH 1/9 v2] " Lee Jones
2013-04-19 12:24 ` Lee Jones
2013-04-19 12:24 ` Lee Jones
2013-04-19 12:26 ` Arnd Bergmann
2013-04-19 12:26 ` Arnd Bergmann
2013-04-19 12:26 ` Arnd Bergmann
2013-04-25 11:49 ` Linus Walleij
2013-04-25 11:49 ` Linus Walleij
2013-04-25 11:49 ` Linus Walleij
2013-04-25 13:46 ` Lee Jones
2013-04-25 13:46 ` Lee Jones
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-18 10:26 ` Lee Jones
2013-04-18 10:26 ` Lee Jones
2013-04-25 11:55 ` Linus Walleij
2013-04-25 11:55 ` Linus Walleij
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-18 10:26 ` Lee Jones
2013-04-25 11:56 ` Linus Walleij
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-18 10:27 ` Lee Jones
2013-04-18 10:27 ` Lee Jones
2013-04-19 12:22 ` [PATCH 4/9 v2] " Lee Jones
2013-04-19 12:22 ` Lee Jones
2013-04-19 12:22 ` Lee Jones
2013-04-19 12:23 ` Arnd Bergmann
2013-04-19 12:23 ` Arnd Bergmann
2013-04-19 12:23 ` Arnd Bergmann
2013-04-25 11:57 ` Linus Walleij
2013-04-25 11:57 ` Linus Walleij
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-18 10:27 ` Lee Jones
2013-04-18 10:27 ` Lee Jones
2013-04-25 12:00 ` Linus Walleij
2013-04-25 12:00 ` Linus Walleij
2013-04-25 12:00 ` Linus Walleij
2013-04-25 13:44 ` Lee Jones
2013-04-25 13:44 ` Lee Jones
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-18 10:27 ` Lee Jones
2013-04-18 10:27 ` Lee Jones
2013-04-25 12:02 ` Linus Walleij
2013-04-25 12:02 ` Linus Walleij
2013-04-25 12:02 ` Linus Walleij
2013-04-25 13:44 ` Lee Jones
2013-04-25 13:44 ` Lee Jones
2013-04-25 13:44 ` Lee Jones
2013-04-25 14:05 ` Linus Walleij
2013-04-25 14:05 ` Linus Walleij
2013-04-25 14:05 ` Linus Walleij
2013-04-25 14:11 ` Arnd Bergmann
2013-04-25 14:11 ` Arnd Bergmann
2013-04-25 14:11 ` Arnd Bergmann
2013-04-26 8:28 ` Linus Walleij
2013-04-26 8:28 ` Linus Walleij
2013-04-26 8:28 ` Linus Walleij
2013-04-26 8:16 ` Vinod Koul
2013-04-26 8:16 ` Vinod Koul
2013-04-26 9:07 ` Linus Walleij
2013-04-26 9:07 ` Linus Walleij
2013-04-26 9:39 ` Arnd Bergmann
2013-04-26 9:39 ` Arnd Bergmann
2013-04-26 9:44 ` Russell King - ARM Linux
2013-04-26 9:44 ` Russell King - ARM Linux
2013-04-26 9:41 ` Russell King - ARM Linux
2013-04-26 9:41 ` Russell King - ARM Linux
2013-04-26 9:41 ` Russell King - ARM Linux
2013-04-30 10:08 ` Vinod Koul [this message]
2013-04-30 10:08 ` Vinod Koul
2013-04-26 9:34 ` Arnd Bergmann
2013-04-26 9:34 ` Arnd Bergmann
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-18 10:27 ` Lee Jones
2013-04-25 12:02 ` Linus Walleij
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-18 10:27 ` Lee Jones
2013-04-18 10:27 ` Lee Jones
2013-04-25 12:03 ` Linus Walleij
2013-04-25 12:03 ` Linus Walleij
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-18 10:27 ` Lee Jones
2013-04-25 12:04 ` Linus Walleij
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
2013-04-18 10:44 ` 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=20130430100837.GB1960@intel.com \
--to=vinod.koul@intel.com \
--cc=andreas.westin@stericsson.com \
--cc=arnd@arndb.de \
--cc=davem@davemloft.net \
--cc=herbert@gondor.hengli.com.au \
--cc=lee.jones@linaro.org \
--cc=linus.walleij@linaro.org \
--cc=linus.walleij@stericsson.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=magnus.p.persson@stericsson.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 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.