Commit 9f6c6328 authored by Karol Wachowski's avatar Karol Wachowski
Browse files

accel/ivpu: Ensure rpm_runtime_put in case of engine reset/resume fail



Previously, aborting work could return early after engine reset or resume
failure, skipping the necessary runtime_put cleanup leaving the device
with incorrect reference count breaking runtime power management state.

Replace early returns with goto statements to ensure runtime_put is always
executed.

Fixes: a47e36dc ("accel/ivpu: Trigger device recovery on engine reset/resume failure")
Reviewed-by: default avatarLizhi Hou <lizhi.hou@amd.com>
Signed-off-by: default avatarKarol Wachowski <karol.wachowski@linux.intel.com>
Link: https://lore.kernel.org/r/20250916084809.850073-1-karol.wachowski@linux.intel.com
parent 7c7a395a
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1014,7 +1014,7 @@ void ivpu_context_abort_work_fn(struct work_struct *work)

	if (vdev->fw->sched_mode == VPU_SCHEDULING_MODE_HW)
		if (ivpu_jsm_reset_engine(vdev, 0))
			return;
			goto runtime_put;

	mutex_lock(&vdev->context_list_lock);
	xa_for_each(&vdev->context_xa, ctx_id, file_priv) {
@@ -1038,7 +1038,7 @@ void ivpu_context_abort_work_fn(struct work_struct *work)
		goto runtime_put;

	if (ivpu_jsm_hws_resume_engine(vdev, 0))
		return;
		goto runtime_put;
	/*
	 * In hardware scheduling mode NPU already has stopped processing jobs
	 * and won't send us any further notifications, thus we have to free job related resources