aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoerg Roedel <jroedel@suse.de>2014-07-09 11:56:43 -0400
committerJoerg Roedel <jroedel@suse.de>2014-07-10 09:36:58 -0400
commitdba3838d7af38b15bcc8ff3437362d449408b547 (patch)
tree6488d8ec212077c76113b24e1bf9f51d8f119dc4
parentf0aac63b873b354c1a16bef03563cbc3941ce7ad (diff)
iommu/amd: Don't hold a reference to task_struct
Since we are only caring about the lifetime of the mm_struct and not the task we can't safely keep a reference to it. The reference is also not needed anymore, so remove that code entirely. Signed-off-by: Joerg Roedel <jroedel@suse.de> Tested-by: Oded Gabbay <Oded.Gabbay@amd.com>
-rw-r--r--drivers/iommu/amd_iommu_v2.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/iommu/amd_iommu_v2.c b/drivers/iommu/amd_iommu_v2.c
index 2b848c01fde0..f7ca009bda67 100644
--- a/drivers/iommu/amd_iommu_v2.c
+++ b/drivers/iommu/amd_iommu_v2.c
@@ -47,7 +47,6 @@ struct pasid_state {
47 atomic_t count; /* Reference count */ 47 atomic_t count; /* Reference count */
48 unsigned mmu_notifier_count; /* Counting nested mmu_notifier 48 unsigned mmu_notifier_count; /* Counting nested mmu_notifier
49 calls */ 49 calls */
50 struct task_struct *task; /* Task bound to this PASID */
51 struct mm_struct *mm; /* mm_struct for the faults */ 50 struct mm_struct *mm; /* mm_struct for the faults */
52 struct mmu_notifier mn; /* mmu_notifier handle */ 51 struct mmu_notifier mn; /* mmu_notifier handle */
53 struct pri_queue pri[PRI_QUEUE_SIZE]; /* PRI tag states */ 52 struct pri_queue pri[PRI_QUEUE_SIZE]; /* PRI tag states */
@@ -531,7 +530,7 @@ static void do_fault(struct work_struct *work)
531 write = !!(fault->flags & PPR_FAULT_WRITE); 530 write = !!(fault->flags & PPR_FAULT_WRITE);
532 531
533 down_read(&fault->state->mm->mmap_sem); 532 down_read(&fault->state->mm->mmap_sem);
534 npages = get_user_pages(fault->state->task, fault->state->mm, 533 npages = get_user_pages(NULL, fault->state->mm,
535 fault->address, 1, write, 0, &page, NULL); 534 fault->address, 1, write, 0, &page, NULL);
536 up_read(&fault->state->mm->mmap_sem); 535 up_read(&fault->state->mm->mmap_sem);
537 536
@@ -672,7 +671,6 @@ int amd_iommu_bind_pasid(struct pci_dev *pdev, int pasid,
672 spin_lock_init(&pasid_state->lock); 671 spin_lock_init(&pasid_state->lock);
673 672
674 mm = get_task_mm(task); 673 mm = get_task_mm(task);
675 pasid_state->task = task;
676 pasid_state->mm = mm; 674 pasid_state->mm = mm;
677 pasid_state->device_state = dev_state; 675 pasid_state->device_state = dev_state;
678 pasid_state->pasid = pasid; 676 pasid_state->pasid = pasid;