aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/1323-drm-amdkfd-Fix-a-bug-that-process-cleanup-is-not-don.patch
blob: 09782c8604e8bdcd8b6f7bf022a7360b3be37373 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
From 129463bb6c80bd4bfc27e83844c9ceb986367f59 Mon Sep 17 00:00:00 2001
From: Yong Zhao <Yong.Zhao@amd.com>
Date: Fri, 28 Jul 2017 17:58:35 -0400
Subject: [PATCH 1323/4131] drm/amdkfd: Fix a bug that process cleanup is not
 done properly

When destroying a queue fails in nocpsch, it may leave other queues
not destroyed and process not unregistered. This commit fixes that.

Change-Id: I9dcf7cb71242aa02e5b72c0381fec19a85f3dfe4
Signed-off-by: Yong Zhao <Yong.Zhao@amd.com>
---
 drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
index 93bf90b..77cabd1 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
@@ -1430,9 +1430,11 @@ static int process_termination_nocpsch(struct device_queue_manager *dqm,
 
 	/* Clear all user mode queues */
 	list_for_each_entry_safe(q, next, &qpd->queues_list, list) {
-		retval = destroy_queue_nocpsch_locked(dqm, qpd, q);
-		if (retval)
-			goto out;
+		int ret;
+
+		ret = destroy_queue_nocpsch_locked(dqm, qpd, q);
+		if (ret)
+			retval = ret;
 	}
 
 	/* Unregister process */
@@ -1445,7 +1447,6 @@ static int process_termination_nocpsch(struct device_queue_manager *dqm,
 		}
 	}
 
-out:
 	mutex_unlock(&dqm->lock);
 	return retval;
 }
-- 
2.7.4