aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/linux-yocto-4.19.8/1994-drm-scheduler-Fix-job-cleanup-without-timeout-handle.patch
diff options
context:
space:
mode:
Diffstat (limited to 'common/recipes-kernel/linux/linux-yocto-4.19.8/1994-drm-scheduler-Fix-job-cleanup-without-timeout-handle.patch')
-rw-r--r--common/recipes-kernel/linux/linux-yocto-4.19.8/1994-drm-scheduler-Fix-job-cleanup-without-timeout-handle.patch42
1 files changed, 42 insertions, 0 deletions
diff --git a/common/recipes-kernel/linux/linux-yocto-4.19.8/1994-drm-scheduler-Fix-job-cleanup-without-timeout-handle.patch b/common/recipes-kernel/linux/linux-yocto-4.19.8/1994-drm-scheduler-Fix-job-cleanup-without-timeout-handle.patch
new file mode 100644
index 00000000..d5fabd5d
--- /dev/null
+++ b/common/recipes-kernel/linux/linux-yocto-4.19.8/1994-drm-scheduler-Fix-job-cleanup-without-timeout-handle.patch
@@ -0,0 +1,42 @@
+From 0a8e4033636f02d59d5c3ae9d9402a318e7d8fc4 Mon Sep 17 00:00:00 2001
+From: Erico Nunes <nunes.erico@gmail.com>
+Date: Tue, 21 May 2019 01:16:49 +0200
+Subject: [PATCH 1994/2940] drm/scheduler: Fix job cleanup without timeout
+ handler
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+After "5918045c4ed4 drm/scheduler: rework job destruction", jobs are
+only deleted when the timeout handler is able to be cancelled
+successfully.
+
+In case no timeout handler is running (timeout == MAX_SCHEDULE_TIMEOUT),
+job cleanup would be skipped which may result in memory leaks.
+
+Add the handling for the (timeout == MAX_SCHEDULE_TIMEOUT) case in
+drm_sched_cleanup_jobs.
+
+Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
+Reviewed-by: Christian König <christian.koenig@amd.com>
+---
+ drivers/gpu/drm/scheduler/sched_main.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/gpu/drm/scheduler/sched_main.c b/drivers/gpu/drm/scheduler/sched_main.c
+index ce614457b884..61b1614702ee 100644
+--- a/drivers/gpu/drm/scheduler/sched_main.c
++++ b/drivers/gpu/drm/scheduler/sched_main.c
+@@ -634,7 +634,8 @@ static void drm_sched_cleanup_jobs(struct drm_gpu_scheduler *sched)
+ unsigned long flags;
+
+ /* Don't destroy jobs while the timeout worker is running */
+- if (!cancel_delayed_work(&sched->work_tdr))
++ if (sched->timeout !=3D MAX_SCHEDULE_TIMEOUT &&
++ !cancel_delayed_work(&sched->work_tdr))
+ return;
+
+
+--
+2.17.1
+