drm/sched: Add locking to drm_sched_entity_modify_sched
authorjsg <jsg@openbsd.org>
Fri, 11 Oct 2024 02:50:17 +0000 (02:50 +0000)
committerjsg <jsg@openbsd.org>
Fri, 11 Oct 2024 02:50:17 +0000 (02:50 +0000)
From Tvrtko Ursulin
579a0a84e3c0174f296004ac4af83cd9819b38a9 in linux-6.6.y/6.6.55
4286cc2c953983d44d248c9de1c81d3a9643345c in mainline linux

sys/dev/pci/drm/scheduler/sched_entity.c

index 1d6409f..4322a62 100644 (file)
@@ -111,8 +111,10 @@ void drm_sched_entity_modify_sched(struct drm_sched_entity *entity,
 {
        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);