]> Gentwo Git Trees - linux/.git/commit
drm/sched: Fix a race in DRM_GPU_SCHED_STAT_NO_HANG test
authorTvrtko Ursulin <tvrtko.ursulin@igalia.com>
Wed, 16 Jul 2025 08:48:17 +0000 (09:48 +0100)
committerPhilipp Stanner <phasta@kernel.org>
Thu, 17 Jul 2025 09:39:19 +0000 (11:39 +0200)
commit2650bc4007c15e05f995f472b4fc89e793162bc4
tree0a84617637ee10a20b5e7ce177d66c83aac7d052
parent28c5c486380cc29e82b7747e999b3238f2887539
drm/sched: Fix a race in DRM_GPU_SCHED_STAT_NO_HANG test

The "skip reset" test waits for the timeout handler to run for the
duration of 2 * MOCK_TIMEOUT, and because the mock scheduler opted to
remove the "skip reset" flag once it fires, this gives opportunity for the
timeout handler to run twice. Second time the job will be removed from the
mock scheduler job list and the drm_mock_sched_advance() call in the test
will fail.

Fix it by making the "don't reset" flag persist for the lifetime of the
job and add a new flag to verify that the code path had executed as
expected.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Fixes: 1472e7549f84 ("drm/sched: Add new test for DRM_GPU_SCHED_STAT_NO_HANG")
Cc: Maíra Canal <mcanal@igalia.com>
Cc: Philipp Stanner <phasta@kernel.org>
Reviewed-by: Maíra Canal <mcanal@igalia.com>
Signed-off-by: Philipp Stanner <phasta@kernel.org>
Link: https://lore.kernel.org/r/20250716084817.56797-1-tvrtko.ursulin@igalia.com
drivers/gpu/drm/scheduler/tests/mock_scheduler.c
drivers/gpu/drm/scheduler/tests/sched_tests.h
drivers/gpu/drm/scheduler/tests/tests_basic.c