Skip to content

Commit 8b824e9

Browse files
drm/ttm: fix locking in test ttm_bo_validate_no_placement_signaled
The test works even without it, but lockdep starts screaming when it is activated. Trivially fix it by acquiring the lock before we try to allocate something. Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Matthew Brost <matthew.brost@intel.com> Link: https://lore.kernel.org/r/20250710144129.1803-1-christian.koenig@amd.com
1 parent 0bcc0f5 commit 8b824e9

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

drivers/gpu/drm/ttm/tests/ttm_bo_validate_test.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -542,14 +542,15 @@ static void ttm_bo_validate_no_placement_signaled(struct kunit *test)
542542
bo->ttm = old_tt;
543543
}
544544

545-
err = ttm_resource_alloc(bo, place, &bo->resource, NULL);
546-
KUNIT_EXPECT_EQ(test, err, 0);
547-
KUNIT_ASSERT_EQ(test, man->usage, size);
548-
549545
placement = kunit_kzalloc(test, sizeof(*placement), GFP_KERNEL);
550546
KUNIT_ASSERT_NOT_NULL(test, placement);
551547

552548
ttm_bo_reserve(bo, false, false, NULL);
549+
550+
err = ttm_resource_alloc(bo, place, &bo->resource, NULL);
551+
KUNIT_EXPECT_EQ(test, err, 0);
552+
KUNIT_ASSERT_EQ(test, man->usage, size);
553+
553554
err = ttm_bo_validate(bo, placement, &ctx);
554555
ttm_bo_unreserve(bo);
555556

0 commit comments

Comments
 (0)