Commit 4d3421e0 authored by Nirmoy Das's avatar Nirmoy Das Committed by Andi Shyti

drm/i915: Fix gt reset with GuC submission is disabled

Currently intel_gt_reset() kills the GuC and then resets requested
engines. This is problematic because there is a dedicated CSB FIFO
which only GuC can access and if that FIFO fills up, the hardware
will block on the next context switch until there is space that means
the system is effectively hung. If an engine is reset whilst actively
executing a context, a CSB entry will be sent to say that the context
has gone idle. Thus if reset happens on a very busy system then
killing GuC before killing the engines will lead to deadlock because
of filled up CSB FIFO.

To address this issue, the GuC should be killed only after resetting
the requested engines and before calling intel_gt_init_hw().

v2: Improve commit message(John)

Cc: John Harrison <john.c.harrison@intel.com>
Signed-off-by: default avatarNirmoy Das <nirmoy.das@intel.com>
Reviewed-by: default avatarJohn Harrison <John.C.Harrison@Intel.com>
Reviewed-by: default avatarAndi Shyti <andi.shyti@linux.intel.com>
Signed-off-by: default avatarAndi Shyti <andi.shyti@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240422201951.633-2-nirmoy.das@intel.com
parent 31c3c53e
......@@ -879,7 +879,16 @@ static intel_engine_mask_t reset_prepare(struct intel_gt *gt)
intel_engine_mask_t awake = 0;
enum intel_engine_id id;
/* For GuC mode, ensure submission is disabled before stopping ring */
/**
* For GuC mode with submission enabled, ensure submission
* is disabled before stopping ring.
*
* For GuC mode with submission disabled, ensure that GuC is not
* sanitized, do that after engine reset. reset_prepare()
* is followed by engine reset which in this mode requires GuC to
* process any CSB FIFO entries generated by the resets.
*/
if (intel_uc_uses_guc_submission(&gt->uc))
intel_uc_reset_prepare(&gt->uc);
for_each_engine(engine, gt, id) {
......@@ -1226,6 +1235,9 @@ void intel_gt_reset(struct intel_gt *gt,
intel_overlay_reset(gt->i915);
/* sanitize uC after engine reset */
if (!intel_uc_uses_guc_submission(&gt->uc))
intel_uc_reset_prepare(&gt->uc);
/*
* Next we need to restore the context, but we don't use those
* yet either...
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment