mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-28 05:12:49 +00:00
drm/i915/guc: Flush G2H handler during a GT reset
Now that the error capture is fully decoupled from fence signalling (request retirement to free memory, which in turn depends on resets) we can safely flush the G2H handler during a GT reset. This eliminates corner cases where GuC generated G2H (e.g. engine resets) race with a GT reset. v2: (John Harrison) - Fix typo in commit message (s/is/in) Signed-off-by: Matthew Brost <matthew.brost@intel.com> Reviewed-by: John Harrison <John.C.Harrison@Intel.com> Signed-off-by: John Harrison <John.C.Harrison@Intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20220121043118.24886-4-matthew.brost@intel.com
This commit is contained in:
parent
1f73a36742
commit
5fe0fdd23e
1 changed files with 1 additions and 17 deletions
|
@ -1395,8 +1395,6 @@ static void guc_flush_destroyed_contexts(struct intel_guc *guc);
|
|||
|
||||
void intel_guc_submission_reset_prepare(struct intel_guc *guc)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (unlikely(!guc_submission_initialized(guc))) {
|
||||
/* Reset called during driver load? GuC not yet initialised! */
|
||||
return;
|
||||
|
@ -1413,21 +1411,7 @@ void intel_guc_submission_reset_prepare(struct intel_guc *guc)
|
|||
|
||||
guc_flush_submissions(guc);
|
||||
guc_flush_destroyed_contexts(guc);
|
||||
|
||||
/*
|
||||
* Handle any outstanding G2Hs before reset. Call IRQ handler directly
|
||||
* each pass as interrupt have been disabled. We always scrub for
|
||||
* outstanding G2H as it is possible for outstanding_submission_g2h to
|
||||
* be incremented after the context state update.
|
||||
*/
|
||||
for (i = 0; i < 4 && atomic_read(&guc->outstanding_submission_g2h); ++i) {
|
||||
intel_guc_to_host_event_handler(guc);
|
||||
#define wait_for_reset(guc, wait_var) \
|
||||
intel_guc_wait_for_pending_msg(guc, wait_var, false, (HZ / 20))
|
||||
do {
|
||||
wait_for_reset(guc, &guc->outstanding_submission_g2h);
|
||||
} while (!list_empty(&guc->ct.requests.incoming));
|
||||
}
|
||||
flush_work(&guc->ct.requests.worker);
|
||||
|
||||
scrub_guc_desc_for_outstanding_g2h(guc);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue