Patch "drm/ttm/tests: Let ttm_bo_test consider different ww_mutex implementation." has been added to the 6.10-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    drm/ttm/tests: Let ttm_bo_test consider different ww_mutex implementation.

to the 6.10-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     drm-ttm-tests-let-ttm_bo_test-consider-different-ww_.patch
and it can be found in the queue-6.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 29c4cbbd9e4b95a321d71746e7343b777cc5b637
Author: Sebastian Andrzej Siewior <bigeasy@xxxxxxxxxxxxx>
Date:   Wed Jun 19 16:46:30 2024 +0200

    drm/ttm/tests: Let ttm_bo_test consider different ww_mutex implementation.
    
    [ Upstream commit f85376c890ef470b64a7fea22eea5af18822f05c ]
    
    PREEMPT_RT has a different locking implementation for ww_mutex. The
    base mutex of struct ww_mutex is declared as struct WW_MUTEX_BASE. The
    latter is defined as `mutex' for non-PREEMPT_RT builds and `rt_mutex'
    for PREEMPT_RT builds.
    
    Using mutex_lock() directly on the base mutex in
    ttm_bo_reserve_deadlock() leads to compile error on PREEMPT_RT.
    
    The locking-selftest has its own defines to deal with this and it is
    probably best to defines the needed one within the test program since
    their usefulness is limited outside of well known selftests.
    
    Provide ww_mutex_base_lock() which points to the correct function for
    PREEMPT_RT and non-PREEMPT_RT builds.
    
    Fixes: 995279d280d1e ("drm/ttm/tests: Add tests for ttm_bo functions")
    Signed-off-by: Sebastian Andrzej Siewior <bigeasy@xxxxxxxxxxxxx>
    Signed-off-by: Maxime Ripard <mripard@xxxxxxxxxx>
    Link: https://patchwork.freedesktop.org/patch/msgid/20240619144630.4DliKOmr@xxxxxxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/gpu/drm/ttm/tests/ttm_bo_test.c b/drivers/gpu/drm/ttm/tests/ttm_bo_test.c
index 1f8a4f8adc929..9cc367a795341 100644
--- a/drivers/gpu/drm/ttm/tests/ttm_bo_test.c
+++ b/drivers/gpu/drm/ttm/tests/ttm_bo_test.c
@@ -18,6 +18,12 @@
 
 #define BO_SIZE		SZ_8K
 
+#ifdef CONFIG_PREEMPT_RT
+#define ww_mutex_base_lock(b)			rt_mutex_lock(b)
+#else
+#define ww_mutex_base_lock(b)			mutex_lock(b)
+#endif
+
 struct ttm_bo_test_case {
 	const char *description;
 	bool interruptible;
@@ -142,7 +148,7 @@ static void ttm_bo_reserve_deadlock(struct kunit *test)
 	bo2 = ttm_bo_kunit_init(test, test->priv, BO_SIZE);
 
 	ww_acquire_init(&ctx1, &reservation_ww_class);
-	mutex_lock(&bo2->base.resv->lock.base);
+	ww_mutex_base_lock(&bo2->base.resv->lock.base);
 
 	/* The deadlock will be caught by WW mutex, don't warn about it */
 	lock_release(&bo2->base.resv->lock.base.dep_map, 1);




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux