From: Nirmoy Das Date: Thu, 5 Dec 2024 11:47:02 +0000 (+0100) Subject: drm/xe/tests: Wait for clear fence operation to complete X-Git-Tag: v6.14-rc1~174^2~17^2~10 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=26bba754539a274fb4905cb07d244ca291bcc5d0;p=thirdparty%2Flinux.git drm/xe/tests: Wait for clear fence operation to complete Ensure the clear operation completes before proceeding, as the clear fence is not attached to the BO's dma-resv object. Cc: Matthew Auld Cc: Thomas Hellström Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20241205114702.1963303-1-nirmoy.das@intel.com Signed-off-by: Nirmoy Das --- diff --git a/drivers/gpu/drm/xe/tests/xe_bo.c b/drivers/gpu/drm/xe/tests/xe_bo.c index 3e0ae40ebbd28..c9ec7a313c6bb 100644 --- a/drivers/gpu/drm/xe/tests/xe_bo.c +++ b/drivers/gpu/drm/xe/tests/xe_bo.c @@ -49,6 +49,13 @@ static int ccs_test_migrate(struct xe_tile *tile, struct xe_bo *bo, KUNIT_FAIL(test, "Failed to submit bo clear.\n"); return PTR_ERR(fence); } + + if (dma_fence_wait_timeout(fence, false, 5 * HZ) <= 0) { + dma_fence_put(fence); + KUNIT_FAIL(test, "Timeout while clearing bo.\n"); + return -ETIME; + } + dma_fence_put(fence); }