From 319a72aa56bf75b7e5de2968bbe2e503722a50f4 Mon Sep 17 00:00:00 2001 From: Harish Kasiviswanathan Date: Mon, 15 Jan 2018 16:50:26 -0500 Subject: [PATCH 3185/4131] drm/amdkfd: Fix eviction fence ref. count Eviction fence is one per kfd_process not per pdd. Fix this. BUG: SWDEV-142052 Change-Id: Ie6cb03228ac86ac310432e4ffd3157c18a32d4f5 Signed-off-by: Harish Kasiviswanathan --- drivers/gpu/drm/amd/amdkfd/kfd_process.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_process.c b/drivers/gpu/drm/amd/amdkfd/kfd_process.c index 64042f1..7bddeb6 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_process.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_process.c @@ -358,11 +358,10 @@ static void kfd_process_destroy_pdds(struct kfd_process *p) list_for_each_entry_safe(pdd, temp, &p->per_device_data, per_device_list) { /* Destroy the GPUVM VM context */ - if (pdd->vm) { - dma_fence_put(p->ef); + if (pdd->vm) pdd->dev->kfd2kgd->destroy_process_vm( pdd->dev->kgd, pdd->vm); - } + list_del(&pdd->per_device_list); if (pdd->qpd.cwsr_kaddr && !pdd->qpd.cwsr_base) @@ -408,6 +407,7 @@ static void kfd_process_wq_release(struct work_struct *work) kfd_process_free_outstanding_kfd_bos(p); kfd_process_destroy_pdds(p); + dma_fence_put(p->ef); kfd_event_free_process(p); -- 2.7.4