iommu.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
From: Ritesh Harjani <ritesh.harjani-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Will Deacon <will.deacon-5wv7dgnIgG8@public.gmane.org>,
	Catalin Marinas <Catalin.Marinas-5wv7dgnIgG8@public.gmane.org>,
	"m.szyprowski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org"
	<m.szyprowski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
Cc: "iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org"
	<iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org>,
	Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>
Subject: Re: IOMMU DMA-mapping API for arm64 ?
Date: Tue, 29 Apr 2014 22:57:40 +0530	[thread overview]
Message-ID: <CAD15agZ8g2R+FrH=6F-HptL3yb-tiVRG33EbLpg55drKeu10Rg@mail.gmail.com> (raw)
In-Reply-To: <20140429125259.GA27770-5wv7dgnIgG8@public.gmane.org>

On Tue, Apr 29, 2014 at 6:22 PM, Will Deacon <will.deacon-5wv7dgnIgG8@public.gmane.org> wrote:
> On Sat, Apr 26, 2014 at 03:28:37PM +0100, Ritesh Harjani wrote:
>> Hi Guys,
>>
>> Need again some help in deciding which all functions/Data structures
>> needs to be moved out from arch/arm/mm/dma-mapping to
>> lib/iommu-helper.c.
>>
>> 1. There is this dma_iommu_mapping structure defination in
>> arch/arm/include/asm/dma-iommu.h. In arm this structure is declared as
>> "mapping" which is part of dev_archdata structure, which is used for
>> IOVA management.
>> Now, does this make sense to move this structure out to
>> include/linux/iommu-helper.h ? And define a config like
>> CONFIG_IOMMU_USE_HELPER_MAPPING (default n) which will be used to,
>> have a variable("mapping") defined or not in dev_archdata of all
>> archs.
>
> In that case, wouldn't it make more sense to put the DMA mapping information
> in the struct device itself, rather than the dev_archdata? The CMA data, for
> example, is stored directly there.

Yes, thanks for pointing out. So, we will have mapping variable put in
device structure.

Will,

So, you think option 1 should be carried out ? This way we can
decouple arch specific things in arch/arm/mm/dma-mapping and other
stuff like IOVA management and buffer management in lib/iommu-helper.c
(thats what lib/swiotlb does too). Only thing to note here is that, we
will have only ARM as the current user of this helper functions.

Once this refactoring is done, later we can modify the
lib/iommu-helper.c functions to make more sense for other archs as
well. My only concern here was that whether we can take out this
dma_iommu_mapping structure. Because currently all archs have their
own way of implementing IOVA management and buffer allocation, but as
in some mail chain it was pointed out that as when the need arises
other arch can modify iommu-helper to suit their needs too.


>
> Will

Marek/Catalin,

Could you guys also comment on this please. If we agree on this
(option 1), then I can take it from there and refactoring should be
fairly straight forward.

Thanks
Ritesh

  parent reply	other threads:[~2014-04-29 17:27 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-27  5:15 IOMMU DMA-mapping API for arm64 ? Ritesh Harjani
     [not found] ` <CAD15agaps45rZT5ko9JKP2CfRF_iTV+0JMDwa239ExgKrRzBYQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-02-27 18:52   ` Will Deacon
     [not found]     ` <20140227185211.GM30003-MRww78TxoiP5vMa5CHWGZ34zcgK1vI+I0E9HWUfgJXw@public.gmane.org>
2014-03-03  8:12       ` Ritesh Harjani
     [not found]         ` <CAD15agZpoT9r7jJgWBgLtinsqgZW=dFLCDE-gmU94T03GeCwQw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-03-03 10:04           ` Marek Szyprowski
     [not found]             ` <53145390.4010408-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2014-03-03 10:25               ` Ritesh Harjani
2014-02-27 19:06   ` Arnd Bergmann
     [not found]     ` <201402272006.51057.arnd-r2nGTMty4D4@public.gmane.org>
2014-03-03  4:21       ` Ritesh Harjani
2014-04-26 14:28       ` Ritesh Harjani
     [not found]         ` <CAD15aga3VAHH9aV134tfp+CgA8x25R_H4DKoPKNkFyAC9FTxBg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-04-29 12:52           ` Will Deacon
     [not found]             ` <20140429125259.GA27770-5wv7dgnIgG8@public.gmane.org>
2014-04-29 17:27               ` Ritesh Harjani [this message]
  -- strict thread matches above, loose matches on Subject: below --
2014-02-06  5:05 Ritesh Harjani
2014-02-06 10:07 ` Will Deacon

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='CAD15agZ8g2R+FrH=6F-HptL3yb-tiVRG33EbLpg55drKeu10Rg@mail.gmail.com' \
    --to=ritesh.harjani-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=Catalin.Marinas-5wv7dgnIgG8@public.gmane.org \
    --cc=arnd-r2nGTMty4D4@public.gmane.org \
    --cc=iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
    --cc=m.szyprowski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
    --cc=will.deacon-5wv7dgnIgG8@public.gmane.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).