From: Greg Kroah-Hartman Date: Mon, 7 Oct 2024 17:50:07 +0000 (+0200) Subject: 5.10-stable patches X-Git-Tag: v6.6.55~58 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d48b59f1ec8c45452fb1d884b95a1e761f8436f5;p=thirdparty%2Fkernel%2Fstable-queue.git 5.10-stable patches added patches: drm-sched-add-locking-to-drm_sched_entity_modify_sched.patch --- diff --git a/queue-5.10/drm-sched-add-locking-to-drm_sched_entity_modify_sched.patch b/queue-5.10/drm-sched-add-locking-to-drm_sched_entity_modify_sched.patch new file mode 100644 index 00000000000..c1516276baa --- /dev/null +++ b/queue-5.10/drm-sched-add-locking-to-drm_sched_entity_modify_sched.patch @@ -0,0 +1,52 @@ +From 4286cc2c953983d44d248c9de1c81d3a9643345c Mon Sep 17 00:00:00 2001 +From: Tvrtko Ursulin +Date: Fri, 13 Sep 2024 17:05:52 +0100 +Subject: drm/sched: Add locking to drm_sched_entity_modify_sched +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Tvrtko Ursulin + +commit 4286cc2c953983d44d248c9de1c81d3a9643345c upstream. + +Without the locking amdgpu currently can race between +amdgpu_ctx_set_entity_priority() (via drm_sched_entity_modify_sched()) and +drm_sched_job_arm(), leading to the latter accesing potentially +inconsitent entity->sched_list and entity->num_sched_list pair. + +v2: + * Improve commit message. (Philipp) + +Signed-off-by: Tvrtko Ursulin +Fixes: b37aced31eb0 ("drm/scheduler: implement a function to modify sched list") +Cc: Christian König +Cc: Alex Deucher +Cc: Luben Tuikov +Cc: Matthew Brost +Cc: David Airlie +Cc: Daniel Vetter +Cc: dri-devel@lists.freedesktop.org +Cc: Philipp Stanner +Cc: # v5.7+ +Reviewed-by: Christian König +Link: https://patchwork.freedesktop.org/patch/msgid/20240913160559.49054-2-tursulin@igalia.com +Signed-off-by: Christian König +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/scheduler/sched_entity.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/drivers/gpu/drm/scheduler/sched_entity.c ++++ b/drivers/gpu/drm/scheduler/sched_entity.c +@@ -96,8 +96,10 @@ void drm_sched_entity_modify_sched(struc + { + WARN_ON(!num_sched_list || !sched_list); + ++ spin_lock(&entity->rq_lock); + entity->sched_list = sched_list; + entity->num_sched_list = num_sched_list; ++ spin_unlock(&entity->rq_lock); + } + EXPORT_SYMBOL(drm_sched_entity_modify_sched); + diff --git a/queue-5.10/series b/queue-5.10/series index 43adfd308f0..045ec4b4d99 100644 --- a/queue-5.10/series +++ b/queue-5.10/series @@ -423,3 +423,4 @@ acpi-resource-add-asus-expertbook-b2502cva-to-irq1_level_low_skip_override.patch btrfs-fix-a-null-pointer-dereference-when-failed-to-start-a-new-trasacntion.patch btrfs-wait-for-fixup-workers-before-stopping-cleaner-kthread-during-umount.patch gpio-davinci-fix-lazy-disable.patch +drm-sched-add-locking-to-drm_sched_entity_modify_sched.patch