Thread (16 messages) 16 messages, 5 authors, 2023-09-14

Re: [PATCH 2/3] iommu: mediatek: Add support of unmanaged iommu domain

From: Robin Murphy <robin.murphy@arm.com>
Date: 2023-01-31 14:15:29
Also in: linux-devicetree, linux-iommu, linux-mediatek, lkml

On 31/01/2023 1:08 pm, Alexandre Bailon wrote:
Hi Robin

On 1/30/23 13:04, Robin Murphy wrote:
quoted
On 2023-01-30 10:27, Alexandre Bailon wrote:
quoted
Currently, the driver can allocate an unmanaged iommu domain.
But, this only works for SoC having multiple bank or multiple iova 
region.
That is for good reason - there is only a single pagetable per bank, 
so if there are multiple devices assigned to a single bank, they 
cannot possibly be attached to different domains at the same time. 
Hence why the banks are modelled as groups.
I understand.
I am trying to upstream a remoteproc driver but the remote processor is
behind the iommu.
remoteproc can manage the iommu but it requires an unmanaged domain.
I tried a couple of things but this cause code duplication,
implies many hacks and not always reliable.
Do you have any suggestion ?
If there are other active devices behind the same IOMMU, and the 
remoteproc device cannot be isolated into its own bank using the 
existing IOMMU driver logic, then the remoteproc driver cannot manage 
the IOMMU directly, and must just use the regular DMA API. There's no 
way around it; you can't have two different parts of the kernel both 
thinking they have exclusive control of a single IOMMU address space at 
the same time. Similarly, remoteproc also cannot take explicit control 
of a multi-device group if it's not actually in control of the other 
devices, since their drivers will not be expecting the DMA address space 
to suddenly change underfoot - that's why iommu_attach_device() has the 
check which you presumably ran into.

Thanks,
Robin.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help