lkml.org 
[lkml]   [2022]   [Jan]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v1 5/8] iommu/amd: Use iommu_attach/detach_device()
Date
The individual device driver should use iommu_attach/detach_device()
for domain attachment/detachment.

Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
---
drivers/iommu/amd/iommu_v2.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/iommu/amd/iommu_v2.c b/drivers/iommu/amd/iommu_v2.c
index 58da08cc3d01..7d9d0fe89064 100644
--- a/drivers/iommu/amd/iommu_v2.c
+++ b/drivers/iommu/amd/iommu_v2.c
@@ -133,7 +133,7 @@ static void free_device_state(struct device_state *dev_state)
if (WARN_ON(!group))
return;

- iommu_detach_group(dev_state->domain, group);
+ iommu_detach_device(dev_state->domain, &dev_state->pdev->dev);

iommu_group_put(group);

@@ -791,7 +791,7 @@ int amd_iommu_init_device(struct pci_dev *pdev, int pasids)
goto out_free_domain;
}

- ret = iommu_attach_group(dev_state->domain, group);
+ ret = iommu_attach_device(dev_state->domain, &pdev->dev);
if (ret != 0)
goto out_drop_group;

--
2.25.1
\
 
 \ /
  Last update: 2022-01-06 03:23    [W:1.187 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site