aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/4322-drm-amdgpu-dont-schedule-jobs-while-in-reset.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/4322-drm-amdgpu-dont-schedule-jobs-while-in-reset.patch')
-rw-r--r--meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/4322-drm-amdgpu-dont-schedule-jobs-while-in-reset.patch50
1 files changed, 50 insertions, 0 deletions
diff --git a/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/4322-drm-amdgpu-dont-schedule-jobs-while-in-reset.patch b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/4322-drm-amdgpu-dont-schedule-jobs-while-in-reset.patch
new file mode 100644
index 00000000..78986057
--- /dev/null
+++ b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/4322-drm-amdgpu-dont-schedule-jobs-while-in-reset.patch
@@ -0,0 +1,50 @@
+From 70c8d49e2851d253b6d9ea62beb9a2661975b633 Mon Sep 17 00:00:00 2001
+From: Shirish S <shirish.s@amd.com>
+Date: Wed, 30 Oct 2019 14:20:46 +0530
+Subject: [PATCH 4322/4736] drm/amdgpu: dont schedule jobs while in reset
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+[Why]
+
+doing kthread_park()/unpark() from drm_sched_entity_fini
+while GPU reset is in progress defeats all the purpose of
+drm_sched_stop->kthread_park.
+If drm_sched_entity_fini->kthread_unpark() happens AFTER
+drm_sched_stop->kthread_park nothing prevents from another
+(third) thread to keep submitting job to HW which will be
+picked up by the unparked scheduler thread and try to submit
+to HW but fail because the HW ring is deactivated.
+
+[How]
+grab the reset lock before calling drm_sched_entity_fini()
+
+Signed-off-by: Shirish S <shirish.s@amd.com>
+Suggested-by: Christian König <christian.koenig@amd.com>
+Reviewed-by: Christian König <christian.koenig@amd.com>
+Reviewed-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
+---
+ drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
+index 22097a3a5bc5..0300635f6f63 100644
+--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
+@@ -607,8 +607,11 @@ void amdgpu_ctx_mgr_entity_fini(struct amdgpu_ctx_mgr *mgr)
+ continue;
+ }
+
+- for (i = 0; i < num_entities; i++)
++ for (i = 0; i < num_entities; i++) {
++ mutex_lock(&ctx->adev->lock_reset);
+ drm_sched_entity_fini(&ctx->entities[0][i].entity);
++ mutex_unlock(&ctx->adev->lock_reset);
++ }
+ }
+ }
+
+--
+2.17.1
+