Skip to content

Commit 905a346

Browse files
mattropeLucas De Marchi
authored andcommitted
drm/xe/kunit: Fix forcewake assertion in mocs test
The MOCS kunit test calls KUNIT_ASSERT_TRUE_MSG() with a condition of 'true;' this prevents the assertion from ever failing. Replace KUNIT_ASSERT_TRUE_MSG with KUNIT_FAIL_AND_ABORT to get the intended failure behavior in cases where forcewake was not acquired successfully. Fixes: 51c0ee8 ("drm/xe/tests/mocs: Hold XE_FORCEWAKE_ALL for LNCF regs") Cc: Tejas Upadhyay <tejas.upadhyay@intel.com> Cc: Gustavo Sousa <gustavo.sousa@intel.com> Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com> Reviewed-by: Gustavo Sousa <gustavo.sousa@intel.com> Link: https://patch.msgid.link/20251113234038.2256106-2-matthew.d.roper@intel.com Signed-off-by: Matt Roper <matthew.d.roper@intel.com> (cherry picked from commit 9be4f0f) Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
1 parent d52dea4 commit 905a346

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/gpu/drm/xe/tests/xe_mocs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ static void read_l3cc_table(struct xe_gt *gt,
4949
fw_ref = xe_force_wake_get(gt_to_fw(gt), XE_FORCEWAKE_ALL);
5050
if (!xe_force_wake_ref_has_domain(fw_ref, XE_FORCEWAKE_ALL)) {
5151
xe_force_wake_put(gt_to_fw(gt), fw_ref);
52-
KUNIT_ASSERT_TRUE_MSG(test, true, "Forcewake Failed.\n");
52+
KUNIT_FAIL_AND_ABORT(test, "Forcewake Failed.\n");
5353
}
5454

5555
for (i = 0; i < info->num_mocs_regs; i++) {

0 commit comments

Comments
 (0)