]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915/guc: Refcount context during error capture
authorJohn Harrison <John.C.Harrison@Intel.com>
Mon, 8 Nov 2021 16:40:54 +0000 (08:40 -0800)
committerJohn Harrison <John.C.Harrison@Intel.com>
Tue, 9 Nov 2021 23:00:50 +0000 (15:00 -0800)
commit07018881da1d3a4855ee96775937bca2e0d8f5a8
treed059842f87c3561960f9c986f598548c66f97cf9
parent8e216c2f44b2b4a14236fea00a80acee14998a64
drm/i915/guc: Refcount context during error capture

When i915 receives a context reset notification from GuC, it triggers
an error capture before resetting any outstanding requsts of that
context. Unfortunately, the error capture is not a time bound
operation. In certain situations it can take a long time, particularly
when multiple large LMEM buffers must be read back and eoncoded. If
this delay is longer than other timeouts (heartbeat, test recovery,
etc.) then a full GT reset can be triggered in the middle.

That can result in the context being reset by GuC actually being
destroyed before the error capture completes and the GuC submission
code resumes. Thus, the GuC side can start dereferencing stale
pointers and Bad Things ensue.

So add a refcount get of the context during the entire reset
operation. That way, the context can't be destroyed part way through
no matter what other resets or user interactions occur.

v2:
 (Matthew Brost)
  - Update patch to work with async error capture
v3:
 (Matthew Brost)
  - Drop async capture support as that hasn't landed yet

Signed-off-by: John Harrison <John.C.Harrison@Intel.com>
Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20211108164054.23588-1-matthew.brost@intel.com
drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c