* add_device vs attach_device
@ 2018-10-02 3:48 Yang Yang
[not found] ` <CAFT6yXGcm1g0G_RAu1usA2mcQ3MSs30ZPZzmL1qNDbOS1cY5Zg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
0 siblings, 1 reply; 2+ messages in thread
From: Yang Yang @ 2018-10-02 3:48 UTC (permalink / raw)
To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA
[-- Attachment #1.1: Type: text/plain, Size: 182 bytes --]
Hi all,
I have a very basic question, what's the difference betwee
arm_smmu_attach_dev()
and arm_smmu_add_device() in ARM SMMUv3 driver? When should I use which
method?
Thanks,
- y
[-- Attachment #1.2: Type: text/html, Size: 1136 bytes --]
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: add_device vs attach_device
[not found] ` <CAFT6yXGcm1g0G_RAu1usA2mcQ3MSs30ZPZzmL1qNDbOS1cY5Zg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2018-10-02 13:45 ` Robin Murphy
0 siblings, 0 replies; 2+ messages in thread
From: Robin Murphy @ 2018-10-02 13:45 UTC (permalink / raw)
To: Yang Yang, iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA
On 02/10/18 04:48, Yang Yang wrote:
> Hi all,
> I have a very basic question, what's the difference betwee
> arm_smmu_attach_dev()
> and arm_smmu_add_device() in ARM SMMUv3 driver? When should I use which
> method?
Add/remove are the low-level interface that give the IOMMU driver a
chance to do any internal housekeeping relevant to the existence of the
given device (note that remove effectively only matters for hotpluggable
devices). Unless you're actually writing an IOMMU driver, you probably
don't need to care.
Attach/detach are the operations for managing which address space
(domain) the device is currently associated with. If you want to make a
driver or subsystem IOMMU-aware and explicitly control its devices'
address mappings, then allocating your own domain, attaching to it, and
using iommu_map/unmap() is the way to go. I'd recommend using
iommu_group_get() and iommu_attach_group() in new code, since
iommu_attach_device() is a bit of a legacy interface, and may not be
valid for some system topologies.
Robin.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-10-02 13:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-02 3:48 add_device vs attach_device Yang Yang
[not found] ` <CAFT6yXGcm1g0G_RAu1usA2mcQ3MSs30ZPZzmL1qNDbOS1cY5Zg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-10-02 13:45 ` Robin Murphy
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.