public inbox for linux-arm-kernel@lists.infradead.org 
 help / color / mirror / Atom feed
From: m.szyprowski@samsung•com (Marek Szyprowski)
To: linux-arm-kernel@lists•infradead.org
Subject: [RFC 0/3] How to pass IOMMU map attr via DMA API?
Date: Fri, 21 Jun 2013 09:17:59 +0200	[thread overview]
Message-ID: <51C3FE27.5070702@samsung.com> (raw)
In-Reply-To: <1371707384-30037-1-git-send-email-hdoyu@nvidia.com>

Hello,

On 6/20/2013 7:49 AM, Hiroshi Doyu wrote:
> In Tegra SoC, IOMMU can set some mapping attribute for each page, for
> exmaple, READable, and WRITEable. We'd like to use this feature
> *newly* for robustness, where read-only pages can be protected from
> being overwritten by wrong operation. We have been using IOMMU via DMA
> mapping API(ARM). DMA mapping API currently doesn't use "prot"
> parameter when calling IOMMU API. So this series tries to pass "struct
> dma_attrs *attrs" via "int prot" in IOMMU API. I'm not so sure if this
> implementation is right or not because:
>
> - Casting (struct dma_attrs *) to (int) in DMA API doesn't look nice.
> - IOMMU layer needs to cast (int) back to (struct dma_attrs *) again,
>    which can be considered as violation of layers.
>
> If you have any implementations/suggestions, it would be really helpful.
>
> This series isn't applied cleanly but this is posted to request for
> comments.

Using DMA attributes for this seems to be a bad idea. The dma direction
parameter is much more appropriate. Will Deacon recently posted a patch
which does it right, see:

https://git.linaro.org/gitweb?p=people/mszyprowski/linux-dma-mapping.git;a=commit;h=8fc3749bd31d139db58f874e093255fe62505968


> Hiroshi Doyu (3):
>    common: DMA-mapping: add DMA_ATTR_READ_ONLY attribute
>    ARM: dma-mapping: Pass DMA attrs as IOMMU prot
>    iommu/tegra: smmu: Support read-only mapping
>
>   arch/arm/mm/dma-mapping.c  | 34 +++++++++++++++++++++-------------
>   drivers/iommu/tegra-smmu.c | 41 +++++++++++++++++++++++++++++------------
>   include/linux/dma-attrs.h  |  1 +
>   3 files changed, 51 insertions(+), 25 deletions(-)
>

Best regards
-- 
Marek Szyprowski
Samsung R&D Institute Poland

  parent reply	other threads:[~2013-06-21  7:17 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-20  5:49 [RFC 0/3] How to pass IOMMU map attr via DMA API? Hiroshi Doyu
     [not found] ` <1371707384-30037-4-git-send-email-hdoyu@nvidia.com>
2013-06-20  6:50   ` [Linaro-mm-sig] [RFC 3/3] iommu/tegra: smmu: Support read-only mapping Kyungmin Park
2013-06-20  7:27     ` Hiroshi Doyu
     [not found] ` <1371707384-30037-3-git-send-email-hdoyu@nvidia.com>
2013-06-20  8:07   ` [Linaro-mm-sig] [RFC 2/3] ARM: dma-mapping: Pass DMA attrs as IOMMU prot Nishanth Peethambaran
2013-06-20  8:24     ` Hiroshi Doyu
2013-06-20  8:55       ` Nishanth Peethambaran
2013-06-20  9:54         ` Hiroshi Doyu
2013-06-20 10:13           ` Arnd Bergmann
2013-06-20 10:34             ` Hiroshi Doyu
2013-06-20 10:57               ` Arnd Bergmann
2013-06-20 12:49                 ` Nishanth Peethambaran
2013-06-20  9:31 ` [RFC 0/3] How to pass IOMMU map attr via DMA API? Will Deacon
2013-06-20  9:59   ` Hiroshi Doyu
2013-06-20 10:11     ` Catalin Marinas
2013-06-20 11:00       ` Hiroshi Doyu
2013-06-20 10:12     ` Will Deacon
2013-06-21  7:17 ` Marek Szyprowski [this message]
2013-06-21 16:03   ` Joerg Roedel
2013-06-24  5:17     ` Hiroshi Doyu
2013-06-24  7:21       ` Joerg Roedel

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=51C3FE27.5070702@samsung.com \
    --to=m.szyprowski@samsung$(echo .)com \
    --cc=linux-arm-kernel@lists$(echo .)infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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