mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 10:00:17 +00:00
iommu/pamu: Use dev_iommu_priv_get/set()
Remove the use of dev->archdata.iommu_domain and use the private per-device pointer provided by IOMMU core code instead. Signed-off-by: Joerg Roedel <jroedel@suse.de> Reviewed-by: Jerry Snitselaar <jsnitsel@redhat.com> Link: https://lore.kernel.org/r/20200625130836.1916-8-joro@8bytes.org
This commit is contained in:
@@ -323,7 +323,7 @@ static void remove_device_ref(struct device_domain_info *info, u32 win_cnt)
|
|||||||
pamu_disable_liodn(info->liodn);
|
pamu_disable_liodn(info->liodn);
|
||||||
spin_unlock_irqrestore(&iommu_lock, flags);
|
spin_unlock_irqrestore(&iommu_lock, flags);
|
||||||
spin_lock_irqsave(&device_domain_lock, flags);
|
spin_lock_irqsave(&device_domain_lock, flags);
|
||||||
info->dev->archdata.iommu_domain = NULL;
|
dev_iommu_priv_set(info->dev, NULL);
|
||||||
kmem_cache_free(iommu_devinfo_cache, info);
|
kmem_cache_free(iommu_devinfo_cache, info);
|
||||||
spin_unlock_irqrestore(&device_domain_lock, flags);
|
spin_unlock_irqrestore(&device_domain_lock, flags);
|
||||||
}
|
}
|
||||||
@@ -352,7 +352,7 @@ static void attach_device(struct fsl_dma_domain *dma_domain, int liodn, struct d
|
|||||||
* Check here if the device is already attached to domain or not.
|
* Check here if the device is already attached to domain or not.
|
||||||
* If the device is already attached to a domain detach it.
|
* If the device is already attached to a domain detach it.
|
||||||
*/
|
*/
|
||||||
old_domain_info = dev->archdata.iommu_domain;
|
old_domain_info = dev_iommu_priv_get(dev);
|
||||||
if (old_domain_info && old_domain_info->domain != dma_domain) {
|
if (old_domain_info && old_domain_info->domain != dma_domain) {
|
||||||
spin_unlock_irqrestore(&device_domain_lock, flags);
|
spin_unlock_irqrestore(&device_domain_lock, flags);
|
||||||
detach_device(dev, old_domain_info->domain);
|
detach_device(dev, old_domain_info->domain);
|
||||||
@@ -371,8 +371,8 @@ static void attach_device(struct fsl_dma_domain *dma_domain, int liodn, struct d
|
|||||||
* the info for the first LIODN as all
|
* the info for the first LIODN as all
|
||||||
* LIODNs share the same domain
|
* LIODNs share the same domain
|
||||||
*/
|
*/
|
||||||
if (!dev->archdata.iommu_domain)
|
if (!dev_iommu_priv_get(dev))
|
||||||
dev->archdata.iommu_domain = info;
|
dev_iommu_priv_set(dev, info);
|
||||||
spin_unlock_irqrestore(&device_domain_lock, flags);
|
spin_unlock_irqrestore(&device_domain_lock, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user