From: Robin Murphy <robin.murphy@arm.com>
To: Jason Gunthorpe <jgg@nvidia.com>
Cc: Will Deacon <will@kernel.org>,
"Tian, Kevin" <kevin.tian@intel.com>,
"Rodel, Jorg" <jroedel@suse.de>,
Qian Cai <quic_qiancai@quicinc.com>,
"iommu@lists.linux-foundation.org"
<iommu@lists.linux-foundation.org>
Subject: Re: [PATCH v2] iommu: iommu_group_claim_dma_owner() must always assign a domain
Date: Mon, 9 May 2022 10:59:11 +0100 [thread overview]
Message-ID: <0f838b34-460c-ed83-7b98-6cda444b10c2@arm.com> (raw)
In-Reply-To: <20220506135431.GC49344@nvidia.com>
On 2022-05-06 14:54, Jason Gunthorpe wrote:
> On Fri, May 06, 2022 at 02:35:50PM +0100, Robin Murphy wrote:
>
>>> So you want to say "DMA is always managed" when attaching a domain of
>>> type IOMMU_DOMAIN_UNMANAGED? :)
>>
>> Touché ;) Just goes to confirm the point above that confusion between
>> general concepts and specific API terms is all too easy. An "unmanaged"
>> domain from the PoV of the API just means it's managed by the external
>> caller, but you're right that that's not necessarily so obvious either.
>
> Yeah, I'm not so keen on the naming used for IOMMU_DOMAIN_*
>
> I looked for a bit and could not figure out why we need to have
> IOMMU_DOMAIN_DMA either.. I didn't find anthing obvious in the iommu
> drivers that looked like a special case for this? Most drivers treat
> it identically to UNMANAGED in their alloc functions
>
> Only mtk, arm-smmu and some odd stuff in Intel seemed to be sensitive?
Yes, that's a relatively recent change[1] - prior to that, drivers did
still have to take (minimal) action to opt into iommu-dma support.
IOMMU_DOMAIN_DMA still needs to exist as a type for the core code to
differentiate internally, so driver involvement is mostly now just a
case of saying "yeah OK fine" if they see it. IOMMU_DOMAIN_DMA_FQ now
effectively takes over the original semantics of IOMMU_DOMAIN_DMA as the
one that depends on driver-specific functionality.
FWIW, mtk-iommu doesn't really have any need to reject
IOMMU_DOMAIN_UNMANAGED, they just don't have any relevant client drivers
that want it; however arm-smmu definitely does need to continue
rejecting IOMMU_DOMAIN_DMA when it can't rely on the DT code ensuring
the correct probe ordering with the old DT binding (otherwise client
drivers are liable to get broken DMA ops).
Thanks,
Robin.
[1]
https://lore.kernel.org/linux-iommu/cover.1628682048.git.robin.murphy@arm.com/
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
next prev parent reply other threads:[~2022-05-09 9:59 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-04 19:08 [PATCH v2] iommu: iommu_group_claim_dma_owner() must always assign a domain Jason Gunthorpe via iommu
2022-05-05 10:56 ` Tian, Kevin
2022-05-05 15:33 ` Jason Gunthorpe via iommu
2022-05-05 18:56 ` Robin Murphy
2022-05-05 19:27 ` Jason Gunthorpe via iommu
2022-05-05 20:07 ` Robin Murphy
2022-05-06 9:41 ` Baolu Lu
2022-05-05 23:28 ` Tian, Kevin
2022-05-06 9:32 ` Robin Murphy
2022-05-06 13:10 ` Jason Gunthorpe via iommu
2022-05-06 13:35 ` Robin Murphy
2022-05-06 13:54 ` Jason Gunthorpe via iommu
2022-05-09 9:59 ` Robin Murphy [this message]
2022-05-09 17:26 ` Jason Gunthorpe via iommu
2022-05-09 22:06 ` Robin Murphy
2022-05-09 23:35 ` Jason Gunthorpe via iommu
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=0f838b34-460c-ed83-7b98-6cda444b10c2@arm.com \
--to=robin.murphy@arm.com \
--cc=iommu@lists.linux-foundation.org \
--cc=jgg@nvidia.com \
--cc=jroedel@suse.de \
--cc=kevin.tian@intel.com \
--cc=quic_qiancai@quicinc.com \
--cc=will@kernel.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