Re: [PATCH 0/5] OMAP IOMMU fixes and IOMMU architecture questions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Joerg,

On Friday 04 April 2014 12:18:11 Joerg Roedel wrote:
> On Fri, Mar 14, 2014 at 12:00:16PM +0100, Laurent Pinchart wrote:
> > Right, we indeed need two levels of API, one for drivers such as
> > remoteproc that need direct control of the IOMMU, and one for drivers that
> > only need to map buffers without any additional requirement. In the second
> > case the drivers should ideally use the DMA mapping API not even be aware
> > that an IOMMU is present. This would require moving the ARM mapping
> > allocation out of the client driver.
> 
> These two levels exist in the form of the DMA-API and the IOMMU-API. In
> fact, the IOMMU-API was created to provide a way to drivers to specifiy
> the IOVA->PHYS mappings on its own.

I agree with you, the two levels are already present, but there's still rough 
edges that we need to soften. 

The ARM DMA API implementation requires someone to create the VA space mapping 
by calling arm_iommu_create_mapping() and attach devices to mappings by 
calling arm_iommu_attach_device(). This must only be performed for devices 
that use the DMA API, devices that manage their IOMMU directly will call to 
the IOMMU API directly.

One obvious possibility is to call those functions in the IOMMU bus masters 
device drivers. This is pretty easy, but makes the drivers IOMMU-aware (which 
I'd like to avoid) and doesn't allow multiple bus masters to share a VA space 
mapping. Another possibility is to place the calls in the IOMMU drivers. This 
has the advantage of removing any IOMMU knowledge from bus masters device 
drivers and allowing multiple bus masters per IOMMU, but makes IOMMU 
management by the DMA API unconditional.

Has anyone given this problem a though ?

> > The IOMMU core or the IOMMU driver will need to know whether the driver
> > expects to control the IOMMU directly or to have it managed transparently.
> > As this is a software configuration I don't think the information belongs
> > to DT. The question is, how should this information be conveyed ?
> 
> The way this works on x86 is that a device driver can use the DMA-API per
> default. If it wants to use the IOMMU-API it has to allocate a domain and
> add the device it handles to this domain (it can't use DMA-API anymore
> then).

Are drivers supposed to reimplement the DMA API internally in that case ?

-- 
Regards,

Laurent Pinchart
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux