Skip to content

Commit 24d032e

Browse files
mattroperodrigovivi
authored andcommitted
drm/i915: Only access SFC_DONE when media domain is not fused off
The SFC_DONE register lives within the corresponding VD0/VD2/VD4/VD6 forcewake domain and is not accessible if the vdbox in that domain is fused off and the forcewake is not initialized. This mistake went unnoticed because until recently we were using the wrong register offset for the SFC_DONE register; once the register offset was corrected, we started hitting errors like <4> [544.989065] i915 0000:cc:00.0: Uninitialized forcewake domain(s) 0x80 accessed at 0x1ce000 on parts with fused-off vdbox engines. Fixes: e50dbdb ("drm/i915/tgl: Add SFC instdone to error state") Fixes: 9c9c6d0 ("drm/i915: Correct SFC_DONE register offset") Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com> Signed-off-by: Matt Roper <matthew.d.roper@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20210806174130.1058960-1-matthew.d.roper@intel.com Reviewed-by: José Roberto de Souza <jose.souza@intel.com> (cherry picked from commit c5589bb) Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com> [Changed Fixes tag to match the cherry-picked 82929a2]
1 parent abd9d66 commit 24d032e

1 file changed

Lines changed: 18 additions & 1 deletion

File tree

drivers/gpu/drm/i915/i915_gpu_error.c

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -727,9 +727,18 @@ static void err_print_gt(struct drm_i915_error_state_buf *m,
727727
if (GRAPHICS_VER(m->i915) >= 12) {
728728
int i;
729729

730-
for (i = 0; i < GEN12_SFC_DONE_MAX; i++)
730+
for (i = 0; i < GEN12_SFC_DONE_MAX; i++) {
731+
/*
732+
* SFC_DONE resides in the VD forcewake domain, so it
733+
* only exists if the corresponding VCS engine is
734+
* present.
735+
*/
736+
if (!HAS_ENGINE(gt->_gt, _VCS(i * 2)))
737+
continue;
738+
731739
err_printf(m, " SFC_DONE[%d]: 0x%08x\n", i,
732740
gt->sfc_done[i]);
741+
}
733742

734743
err_printf(m, " GAM_DONE: 0x%08x\n", gt->gam_done);
735744
}
@@ -1581,6 +1590,14 @@ static void gt_record_regs(struct intel_gt_coredump *gt)
15811590

15821591
if (GRAPHICS_VER(i915) >= 12) {
15831592
for (i = 0; i < GEN12_SFC_DONE_MAX; i++) {
1593+
/*
1594+
* SFC_DONE resides in the VD forcewake domain, so it
1595+
* only exists if the corresponding VCS engine is
1596+
* present.
1597+
*/
1598+
if (!HAS_ENGINE(gt->_gt, _VCS(i * 2)))
1599+
continue;
1600+
15841601
gt->sfc_done[i] =
15851602
intel_uncore_read(uncore, GEN12_SFC_DONE(i));
15861603
}

0 commit comments

Comments
 (0)