]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
accel/ivpu: Fix missing MMU events if file_priv is unbound
authorKarol Wachowski <karol.wachowski@intel.com>
Wed, 29 Jan 2025 12:56:33 +0000 (13:56 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 22 May 2025 12:31:57 +0000 (14:31 +0200)
commit 2f5bbea1807a064a1e4c1b385c8cea4f37bb4b17 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>
drivers/accel/ivpu/ivpu_job.c

index e5612cf3d854c16bcc89583f38eaf3556f2e2ace..4a8013f669f912c65b59582219a49a9d0e6fc244 100644 (file)
@@ -369,7 +369,6 @@ void ivpu_context_abort_locked(struct ivpu_file_priv *file_priv)
                ivpu_jsm_context_release(vdev, file_priv->ctx.id);
 
        ivpu_mmu_disable_ssid_events(vdev, file_priv->ctx.id);
-       ivpu_mmu_discard_events(vdev);
 
        file_priv->aborted = true;
 }
@@ -872,6 +871,13 @@ void ivpu_context_abort_work_fn(struct work_struct *work)
        }
        mutex_unlock(&vdev->context_list_lock);
 
+       /*
+        * We will not receive new MMU event interrupts until existing events are discarded
+        * however, we want to discard these events only after aborting the faulty context
+        * to avoid generating new faults from that context
+        */
+       ivpu_mmu_discard_events(vdev);
+
        if (vdev->fw->sched_mode != VPU_SCHEDULING_MODE_HW)
                return;