drm/xe/guc_submit: prevent repeated unregister
authorMatthew Auld <matthew.auld@intel.com>
Thu, 3 Aug 2023 17:38:50 +0000 (18:38 +0100)
committerRodrigo Vivi <rodrigo.vivi@intel.com>
Thu, 21 Dec 2023 16:39:29 +0000 (11:39 -0500)
commit31b57683de2c98ac6a3de7223ef0afd47731265c
treec8cb747a65794fe835f91ea8ca2d7f778155930a
parentd8b4494bf184d43295b89156d7656d69f931e418
drm/xe/guc_submit: prevent repeated unregister

It seems that various things can trigger the lr cleanup worker,
including CAT error, engine reset and destroying the actual engine, so
seems plausible to end up triggering the worker more than once in some
cases. If that does happen we can race with an ongoing engine deregister
before it has completed, thus triggering it again and also changing the
state back into pending_disable. Checking if the engine has been marked
as destroyed looks like it should prevent this.

Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Matthew Brost <matthew.brost@intel.com>
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
drivers/gpu/drm/xe/xe_guc_submit.c