Skip to content

Commit 5a276d3

Browse files
tomitamoekogregkh
authored andcommitted
Revert "drm/xe/tests/mocs: Update xe_force_wake_get() return handling"
This reverts commit 95a75ed. The reverted commit updated the handling of xe_force_wake_get to match the new "return refcounted domain mask" semantics introduced in commit a7ddcea ("drm/xe: Error handling in xe_force_wake_get()"). However, that API change only exists in 6.13 and later. In 6.12 stable kernel, xe_force_wake_get still returns a status code. The update incorrectly treats the return value as a mask, causing the return value of 0 to be misinterpreted as an error. Cc: Rodrigo Vivi <[email protected]> Cc: Lucas De Marchi <[email protected]> Cc: Himal Prasad Ghimiray <[email protected]> Cc: Nirmoy Das <[email protected]> Cc: Badal Nilawar <[email protected]> Acked-by: Rodrigo Vivi <[email protected]> Signed-off-by: Tomita Moeko <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent c72303e commit 5a276d3

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

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

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,12 @@ static void read_l3cc_table(struct xe_gt *gt,
4343
{
4444
struct kunit *test = kunit_get_current_test();
4545
u32 l3cc, l3cc_expected;
46-
unsigned int fw_ref, i;
46+
unsigned int i;
4747
u32 reg_val;
48+
u32 ret;
4849

49-
fw_ref = xe_force_wake_get(gt_to_fw(gt), XE_FORCEWAKE_ALL);
50-
if (!xe_force_wake_ref_has_domain(fw_ref, XE_FORCEWAKE_ALL)) {
51-
xe_force_wake_put(gt_to_fw(gt), fw_ref);
52-
KUNIT_ASSERT_TRUE_MSG(test, true, "Forcewake Failed.\n");
53-
}
50+
ret = xe_force_wake_get(gt_to_fw(gt), XE_FORCEWAKE_ALL);
51+
KUNIT_ASSERT_EQ_MSG(test, ret, 0, "Forcewake Failed.\n");
5452

5553
for (i = 0; i < info->num_mocs_regs; i++) {
5654
if (!(i & 1)) {
@@ -74,22 +72,23 @@ static void read_l3cc_table(struct xe_gt *gt,
7472
KUNIT_EXPECT_EQ_MSG(test, l3cc_expected, l3cc,
7573
"l3cc idx=%u has incorrect val.\n", i);
7674
}
77-
xe_force_wake_put(gt_to_fw(gt), fw_ref);
75+
xe_force_wake_put(gt_to_fw(gt), XE_FORCEWAKE_ALL);
7876
}
7977

8078
static void read_mocs_table(struct xe_gt *gt,
8179
const struct xe_mocs_info *info)
8280
{
8381
struct kunit *test = kunit_get_current_test();
8482
u32 mocs, mocs_expected;
85-
unsigned int fw_ref, i;
83+
unsigned int i;
8684
u32 reg_val;
85+
u32 ret;
8786

8887
KUNIT_EXPECT_TRUE_MSG(test, info->unused_entries_index,
8988
"Unused entries index should have been defined\n");
9089

91-
fw_ref = xe_force_wake_get(gt_to_fw(gt), XE_FW_GT);
92-
KUNIT_ASSERT_NE_MSG(test, fw_ref, 0, "Forcewake Failed.\n");
90+
ret = xe_force_wake_get(gt_to_fw(gt), XE_FW_GT);
91+
KUNIT_ASSERT_EQ_MSG(test, ret, 0, "Forcewake Failed.\n");
9392

9493
for (i = 0; i < info->num_mocs_regs; i++) {
9594
if (regs_are_mcr(gt))
@@ -107,7 +106,7 @@ static void read_mocs_table(struct xe_gt *gt,
107106
"mocs reg 0x%x has incorrect val.\n", i);
108107
}
109108

110-
xe_force_wake_put(gt_to_fw(gt), fw_ref);
109+
xe_force_wake_put(gt_to_fw(gt), XE_FW_GT);
111110
}
112111

113112
static int mocs_kernel_test_run_device(struct xe_device *xe)

0 commit comments

Comments
 (0)