Skip to content
Snippets Groups Projects
Commit b939a08b authored by Zhanjun Dong's avatar Zhanjun Dong Committed by John Harrison
Browse files

drm/i915/guc: Flush ct receive tasklet during reset preparation

GuC to host communication is interrupt driven, the handling has 3
parts: interrupt context, tasklet and request queue worker.
During GuC reset prepare, interrupt is disabled before destroy
contexts steps start. The IRQ and worker are flushed to finish
any outstanding in-progress message handling. But, the tasklet
flush is missing, it might causes 2 race conditions:
1. Tasklet runs after IRQ flushed, add request to queue after worker
flush started, causes unexpected G2H message request processing,
meanwhile, reset prepare code already get the context destroyed.
This will causes error reported about bad context state.
(#11349 and
#12303)
2. Tasklet runs after intel_guc_submission_reset_prepare,
ct_try_receive_message start to run, while intel_uc_reset_prepare
already finished guc sanitize and set ct->enable to false. This will
causes warning on incorrect ct->enable state.
(#12439

)

Add the missing tasklet flush to flush all 3 parts.

Signed-off-by: default avatarZhanjun Dong <zhanjun.dong@intel.com>
Reviewed-by: default avatarAlan Previn <alan.previn.teres.alexis@intel.com>
Signed-off-by: default avatarJohn Harrison <John.C.Harrison@Intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241104214103.214702-1-zhanjun.dong@intel.com
parent 79367b7a
No related branches found
No related tags found
No related merge requests found
...@@ -1688,6 +1688,10 @@ void intel_guc_submission_reset_prepare(struct intel_guc *guc) ...@@ -1688,6 +1688,10 @@ void intel_guc_submission_reset_prepare(struct intel_guc *guc)
spin_lock_irq(guc_to_gt(guc)->irq_lock); spin_lock_irq(guc_to_gt(guc)->irq_lock);
spin_unlock_irq(guc_to_gt(guc)->irq_lock); spin_unlock_irq(guc_to_gt(guc)->irq_lock);
/* Flush tasklet */
tasklet_disable(&guc->ct.receive_tasklet);
tasklet_enable(&guc->ct.receive_tasklet);
guc_flush_submissions(guc); guc_flush_submissions(guc);
guc_flush_destroyed_contexts(guc); guc_flush_destroyed_contexts(guc);
flush_work(&guc->ct.requests.worker); flush_work(&guc->ct.requests.worker);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment