Skip to content

Commit 20a05c3

Browse files
kwachowsgregkh
authored andcommitted
accel/ivpu: Fix missing MMU events if file_priv is unbound
commit 2f5bbea upstream. Move the ivpu_mmu_discard_events() function to the common portion of the abort work function. This ensures it is called only once, even if there are no faulty contexts in context_xa, to guarantee that MMU events are discarded and new events are not missed. Reviewed-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com> Signed-off-by: Karol Wachowski <karol.wachowski@intel.com> Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com> Signed-off-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20250129125636.1047413-4-jacek.lawrynowicz@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 0a88a15 commit 20a05c3

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

drivers/accel/ivpu/ivpu_job.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,6 @@ void ivpu_context_abort_locked(struct ivpu_file_priv *file_priv)
369369
ivpu_jsm_context_release(vdev, file_priv->ctx.id);
370370

371371
ivpu_mmu_disable_ssid_events(vdev, file_priv->ctx.id);
372-
ivpu_mmu_discard_events(vdev);
373372

374373
file_priv->aborted = true;
375374
}
@@ -872,6 +871,13 @@ void ivpu_context_abort_work_fn(struct work_struct *work)
872871
}
873872
mutex_unlock(&vdev->context_list_lock);
874873

874+
/*
875+
* We will not receive new MMU event interrupts until existing events are discarded
876+
* however, we want to discard these events only after aborting the faulty context
877+
* to avoid generating new faults from that context
878+
*/
879+
ivpu_mmu_discard_events(vdev);
880+
875881
if (vdev->fw->sched_mode != VPU_SCHEDULING_MODE_HW)
876882
return;
877883

0 commit comments

Comments
 (0)