diff options
author | Joerg Roedel <jroedel@suse.de> | 2014-07-08 08:19:35 -0400 |
---|---|---|
committer | Joerg Roedel <jroedel@suse.de> | 2014-07-10 09:36:34 -0400 |
commit | 61feb43897ec1cf8b126689035b249f30b0d90ad (patch) | |
tree | 4b1443309702cb745318d23b45db7884adfa3be8 /drivers/iommu | |
parent | c5db16ad6cc15c261639c0105cfff72df4122790 (diff) |
iommu/amd: Get rid of __unbind_pasid
Unbind_pasid is only called from mn_release which already
has the pasid_state. Use this to simplify the unbind_pasid
path and get rid of __unbind_pasid.
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Tested-by: Oded Gabbay <Oded.Gabbay@amd.com>
Diffstat (limited to 'drivers/iommu')
-rw-r--r-- | drivers/iommu/amd_iommu_v2.c | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/drivers/iommu/amd_iommu_v2.c b/drivers/iommu/amd_iommu_v2.c index a621552e715d..574c71bdfcfa 100644 --- a/drivers/iommu/amd_iommu_v2.c +++ b/drivers/iommu/amd_iommu_v2.c | |||
@@ -99,7 +99,6 @@ static struct workqueue_struct *iommu_wq; | |||
99 | static u64 *empty_page_table; | 99 | static u64 *empty_page_table; |
100 | 100 | ||
101 | static void free_pasid_states(struct device_state *dev_state); | 101 | static void free_pasid_states(struct device_state *dev_state); |
102 | static void unbind_pasid(struct device_state *dev_state, int pasid); | ||
103 | 102 | ||
104 | static u16 device_id(struct pci_dev *pdev) | 103 | static u16 device_id(struct pci_dev *pdev) |
105 | { | 104 | { |
@@ -301,7 +300,7 @@ static void put_pasid_state_wait(struct pasid_state *pasid_state) | |||
301 | free_pasid_state(pasid_state); | 300 | free_pasid_state(pasid_state); |
302 | } | 301 | } |
303 | 302 | ||
304 | static void __unbind_pasid(struct pasid_state *pasid_state) | 303 | static void unbind_pasid(struct pasid_state *pasid_state) |
305 | { | 304 | { |
306 | struct iommu_domain *domain; | 305 | struct iommu_domain *domain; |
307 | 306 | ||
@@ -314,18 +313,6 @@ static void __unbind_pasid(struct pasid_state *pasid_state) | |||
314 | flush_workqueue(iommu_wq); | 313 | flush_workqueue(iommu_wq); |
315 | } | 314 | } |
316 | 315 | ||
317 | static void unbind_pasid(struct device_state *dev_state, int pasid) | ||
318 | { | ||
319 | struct pasid_state *pasid_state; | ||
320 | |||
321 | pasid_state = get_pasid_state(dev_state, pasid); | ||
322 | if (pasid_state == NULL) | ||
323 | return; | ||
324 | |||
325 | __unbind_pasid(pasid_state); | ||
326 | put_pasid_state(pasid_state); /* Reference taken in this function */ | ||
327 | } | ||
328 | |||
329 | static void free_pasid_states_level1(struct pasid_state **tbl) | 316 | static void free_pasid_states_level1(struct pasid_state **tbl) |
330 | { | 317 | { |
331 | int i; | 318 | int i; |
@@ -480,7 +467,7 @@ static void mn_release(struct mmu_notifier *mn, struct mm_struct *mm) | |||
480 | if (pasid_state->device_state->inv_ctx_cb) | 467 | if (pasid_state->device_state->inv_ctx_cb) |
481 | dev_state->inv_ctx_cb(dev_state->pdev, pasid_state->pasid); | 468 | dev_state->inv_ctx_cb(dev_state->pdev, pasid_state->pasid); |
482 | 469 | ||
483 | unbind_pasid(dev_state, pasid_state->pasid); | 470 | unbind_pasid(pasid_state); |
484 | } | 471 | } |
485 | 472 | ||
486 | static struct mmu_notifier_ops iommu_mn = { | 473 | static struct mmu_notifier_ops iommu_mn = { |