[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120919095843.d1db155e0f085f4fcf64ea32@nvidia.com>
Date: Wed, 19 Sep 2012 09:58:43 +0300
From: Hiroshi Doyu <hdoyu@...dia.com>
To: Joerg Roedel <joerg.roedel@....com>
CC: "m.szyprowski@...sung.com" <m.szyprowski@...sung.com>,
"linux@....linux.org.uk" <linux@....linux.org.uk>,
"arnd@...db.de" <arnd@...db.de>,
"minchan@...nel.org" <minchan@...nel.org>,
"chunsang.jeong@...aro.org" <chunsang.jeong@...aro.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"subashrp@...il.com" <subashrp@...il.com>,
"linaro-mm-sig@...ts.linaro.org" <linaro-mm-sig@...ts.linaro.org>,
"linux-mm@...ck.org" <linux-mm@...ck.org>,
"iommu@...ts.linux-foundation.org" <iommu@...ts.linux-foundation.org>,
Krishna Reddy <vdumpa@...dia.com>,
"linux-tegra@...r.kernel.org" <linux-tegra@...r.kernel.org>,
"kyungmin.park@...sung.com" <kyungmin.park@...sung.com>,
"pullip.cho@...sung.com" <pullip.cho@...sung.com>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>
Subject: Re: [RFC 0/5] ARM: dma-mapping: New dma_map_ops to control IOVA
more precisely
Hi Joerg,
On Tue, 18 Sep 2012 14:49:18 +0200
Joerg Roedel <joerg.roedel@....com> wrote:
> On Wed, Aug 29, 2012 at 09:55:30AM +0300, Hiroshi Doyu wrote:
> > The following APIs are needed for us to support the legacy Tegra
> > memory manager for devices("NvMap") with *DMA mapping API*.
>
> Maybe I am not understanding the need completly. Can you elaborate on
> why this is needed for legacy Tegra?
Actually not for legacy but it's necessary to replace homebrewed
in-kernel API(not upstreamed) with the standard ones. The homebrewed
in-kernel API has been used for the abvoe nvmap as its backend. The
homebrewed ones are being replaced with the standard ones, IOMMU-API,
DMA-API and dma-buf, mainly for transition purpose. I found that some
missing features in DMA-API for that. I posted since other SoCs may
have the similiar requirements, (1) To specify IOVA address at
allocation, and (2) To have IOVA allocation and mapping separately.
> > New API:
> >
> > ->iova_alloc(): To allocate IOVA area.
> > ->iova_alloc_at(): To allocate IOVA area at specific address.
> > ->iova_free(): To free IOVA area.
> >
> > ->map_page_at(): To map page at specific IOVA.
>
> This sounds like a layering violation. The situation today is as
> follows:
>
> DMA-API : Handle DMA-addresses including an address allocator
> IOMMU-API : Full control over DMA address space, no address
> allocator
>
> So what you want to do add to the DMA-API is already part of the
> IOMMU-API.
>
> Here is my suggestion what you can do instead of extending the DMA-API.
> You can use the IOMMU-API to initialize the device address space with
> any mappings at the IOVAs you need the mappings. In the end you allocate
> another free range in the device address space and use that to satisfy
> DMA-API allocations. Any reason why that could not work?
I guess that it would work. Originally I thought that using DMA-API
and IOMMU-API together in driver might be kind of layering violation
since IOMMU-API itself is used in DMA-API. Only DMA-API used in driver
might be cleaner. Considering that DMA API traditionally handling
*anonymous* {bus,iova} address only, introducing the concept of
specific address in DMA API may not be so encouraged, though.
It would be nice to listen how other SoCs have solved similar needs.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists