Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <matthew.auld@intel.com>
Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241205114702.1963303-1-nirmoy.das@intel.com
Signed-off-by: Nirmoy Das <nirmoy.das@intel.com>

+7
+7
drivers/gpu/drm/xe/tests/xe_bo.c
··· 49 49 KUNIT_FAIL(test, "Failed to submit bo clear.\n"); 50 50 return PTR_ERR(fence); 51 51 } 52 + 53 + if (dma_fence_wait_timeout(fence, false, 5 * HZ) <= 0) { 54 + dma_fence_put(fence); 55 + KUNIT_FAIL(test, "Timeout while clearing bo.\n"); 56 + return -ETIME; 57 + } 58 + 52 59 dma_fence_put(fence); 53 60 } 54 61