Skip to content

Commit 4ce18e6

Browse files
tejasupjfvogel
authored andcommitted
drm/xe/tests/mocs: Hold XE_FORCEWAKE_ALL for LNCF regs
[ Upstream commit 51c0ee84e4dc339287b2d7335f2b54d747794c83 ] LNCF registers report wrong values when XE_FORCEWAKE_GT only is held. Holding XE_FORCEWAKE_ALL ensures correct operations on LNCF regs. V2(Himal): - Use xe_force_wake_ref_has_domain Closes: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/1999 Fixes: a6a4ea6 ("drm/xe: Add mocs kunit") Reviewed-by: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20250428082357.1730068-1-tejas.upadhyay@intel.com Signed-off-by: Tejas Upadhyay <tejas.upadhyay@intel.com> (cherry picked from commit 70a2585e582058e94fe4381a337be42dec800337) Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com> Signed-off-by: Sasha Levin <sashal@kernel.org> (cherry picked from commit 944af45bb76bf7492de6c1e6033c34e5198ccf0d) Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
1 parent 19a4997 commit 4ce18e6

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,11 @@ static void read_l3cc_table(struct xe_gt *gt,
4646
unsigned int fw_ref, i;
4747
u32 reg_val;
4848

49-
fw_ref = xe_force_wake_get(gt_to_fw(gt), XE_FW_GT);
50-
KUNIT_ASSERT_NE_MSG(test, fw_ref, 0, "Forcewake Failed.\n");
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+
}
5154

5255
for (i = 0; i < info->num_mocs_regs; i++) {
5356
if (!(i & 1)) {

0 commit comments

Comments
 (0)