All of lore.kernel.org
 help / color / mirror / Atom feed
From: Karol Wachowski <karol.wachowski@linux.intel.com>
To: Lizhi Hou <lizhi.hou@amd.com>, dri-devel@lists.freedesktop.org
Cc: oded.gabbay@gmail.com, jeff.hugo@oss.qualcomm.com,
	maciej.falkowski@linux.intel.com
Subject: Re: [PATCH] accel/ivpu: Ensure rpm_runtime_put in case of engine reset/resume fail
Date: Tue, 16 Sep 2025 10:48:53 +0200	[thread overview]
Message-ID: <f1a2ba49-edb3-4336-a07e-750c7fa2bb3b@linux.intel.com> (raw)
In-Reply-To: <b0f6a51f-5a83-79d2-7046-3dada6bb61b8@amd.com>

Thanks, I've sent v1 version with added fixes tag.

Karol

On 9/15/2025 10:15 PM, Lizhi Hou wrote:
> This looks a bug fix. Is adding 'Fixes:' tag better?
>
> On 9/15/25 03:35, Karol Wachowski wrote:
>> 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.
>>
>> Signed-off-by: Karol Wachowski <karol.wachowski@linux.intel.com>
>> ---
>>   drivers/accel/ivpu/ivpu_job.c | 4 ++--
>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/accel/ivpu/ivpu_job.c
>> b/drivers/accel/ivpu/ivpu_job.c
>> index 521b7ac6e35e..044268d0fc87 100644
>> --- a/drivers/accel/ivpu/ivpu_job.c
>> +++ b/drivers/accel/ivpu/ivpu_job.c
>> @@ -1050,7 +1050,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) {
>> @@ -1074,7 +1074,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

      reply	other threads:[~2025-09-16  8:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-15 10:35 [PATCH] accel/ivpu: Ensure rpm_runtime_put in case of engine reset/resume fail Karol Wachowski
2025-09-15 20:15 ` Lizhi Hou
2025-09-16  8:48   ` Karol Wachowski [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f1a2ba49-edb3-4336-a07e-750c7fa2bb3b@linux.intel.com \
    --to=karol.wachowski@linux.intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jeff.hugo@oss.qualcomm.com \
    --cc=lizhi.hou@amd.com \
    --cc=maciej.falkowski@linux.intel.com \
    --cc=oded.gabbay@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.