Hey, Den 2026-03-04 kl. 06:54, skrev Hogander, Jouni: > On Thu, 2026-02-26 at 16:12 +0100, Maarten Lankhorst wrote: >> Fix a compile error in the kunit tests when CONFIG_PREEMPT_RT is >> enabled, and the normal mutex is converted into a rtmutex. >> >> Reported-by: kernel test robot <[email protected]> >> Closes: >> https://lore.kernel.org/oe-kbuild-all/[email protected]/ >> Signed-off-by: Maarten Lankhorst <[email protected]> >> --- >> drivers/gpu/drm/ttm/tests/ttm_bo_test.c | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/drivers/gpu/drm/ttm/tests/ttm_bo_test.c >> b/drivers/gpu/drm/ttm/tests/ttm_bo_test.c >> index d468f83220720..2ba5ddf2b1c9e 100644 >> --- a/drivers/gpu/drm/ttm/tests/ttm_bo_test.c >> +++ b/drivers/gpu/drm/ttm/tests/ttm_bo_test.c >> @@ -222,13 +222,13 @@ static void ttm_bo_reserve_interrupted(struct >> kunit *test) >> KUNIT_FAIL(test, "Couldn't create ttm bo reserve >> task\n"); >> >> /* Take a lock so the threaded reserve has to wait */ >> - mutex_lock(&bo->base.resv->lock.base); >> + ww_mutex_lock(&bo->base.resv->lock, NULL); > > There is this comment in include/linux/dma-resv.h:dma_resv:lock : > > * Update side lock. Don't use directly, instead use the wrapper > * functions like dma_resv_lock() and dma_resv_unlock(). > > BR, > Jouni Högander > >> >> wake_up_process(task); >> msleep(20); >> err = kthread_stop(task); >> >> - mutex_unlock(&bo->base.resv->lock.base); >> + ww_mutex_unlock(&bo->base.resv->lock); >> >> KUNIT_ASSERT_EQ(test, err, -ERESTARTSYS); >> } >
Well spotted, no reason not to use dma_resv_lock/unlock() here. Will resubmit! Kind regards, Maarten Lankhorst
