linux/drivers/gpu/drm/scheduler
Shixiong Ou 28cc4d5a75 drm/sched: Create a fake device for KUnit tests
The DRM scheduler KUnit tests pass NULL for the dev field in
drm_sched_init_args, which NULL-pointer dereferences in the drm_sched_job
trace event via dev_name() on sched->dev.

Give the mock scheduler a device with kunit_device_register(), which is
also cleaned up at test exit. A per-function counter keeps the device
names unique, since some tests create several mock schedulers.

Fixes: 5a99350794 ("drm/sched: Add scheduler unit testing infrastructure and some basic tests")
Cc: stable@vger.kernel.org
Signed-off-by: Shixiong Ou <oushixiong@kylinos.cn>
Acked-by: Maxime Ripard <mripard@kernel.org>
[phasta: removed static variable init to 0 again]
Signed-off-by: Philipp Stanner <phasta@kernel.org>
Link: https://patch.msgid.link/20260908055941.351486-1-oushixiong1025@163.com
2026-09-08 14:25:54 +02:00
..
tests drm/sched: Create a fake device for KUnit tests 2026-09-08 14:25:54 +02:00
.kunitconfig drm/sched: Add scheduler unit testing infrastructure and some basic tests 2025-03-24 10:41:52 +01:00
gpu_scheduler_trace.h drm/doc: Document some tracepoints as uAPI 2025-05-28 16:16:18 +02:00
Makefile drm/sched: Move run queue related code into a separate file 2026-04-17 14:43:28 +02:00
sched_entity.c Linux 7.2 2026-08-20 10:58:44 +10:00
sched_fence.c Revert "drm/sched: Embed run queue singleton into the scheduler" 2026-08-11 17:34:06 +01:00
sched_internal.h Revert "drm/sched: Remove FIFO and RR and simplify to a single run queue" 2026-08-11 17:34:10 +01:00
sched_main.c Linux 7.2 2026-08-20 10:58:44 +10:00
sched_rq.c Revert "drm/sched: Remove FIFO and RR and simplify to a single run queue" 2026-08-11 17:34:10 +01:00