All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrzej Kacprowski <andrzej.kacprowski@linux.intel.com>
To: sashiko-reviews@lists.linux.dev
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] accel/ivpu: Improve IVPU_TEST_MODE_FW_TEST handling
Date: Wed, 7 Oct 2026 18:17:46 +0200	[thread overview]
Message-ID: <f3030543-45f3-4719-b8a9-4fd6226263e6@linux.intel.com> (raw)
In-Reply-To: <sashiko-outbox-162864@kernel.org>

On 07-Oct-26 12:38 PM, sashiko-bot@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> - [High] accel/ivpu: IRQ disable depth leak in FW_TEST mode due to unbalanced disable_irq()
> --
> 
> commit 03c00af9f26af13756e29777951597b1aedc577d
> Author: Andrzej Kacprowski <andrzej.kacprowski@linux.intel.com>
> 
> accel/ivpu: Improve IVPU_TEST_MODE_FW_TEST handling
> 
> When driver is operating in IVPU_TEST_MODE_FW_TEST debug mode
> it should boot the firmware, but skip communication with
> the firmware. There is no need to enable interrupts or send messages.
> The output of the firmware test will be available in the
> firmware log.
> 
>> diff --git a/drivers/accel/ivpu/ivpu_drv.c b/drivers/accel/ivpu/ivpu_drv.c
>> index 647684219e9d3..d66abf645e7b9 100644
>> --- a/drivers/accel/ivpu/ivpu_drv.c
>> +++ b/drivers/accel/ivpu/ivpu_drv.c
> 
> [ ... ]
> 
>> @@ -487,6 +484,9 @@ int ivpu_boot(struct ivpu_device *vdev)
>>   		return ret;
>>   	}
>>   
>> +	if (ivpu_test_mode & IVPU_TEST_MODE_FW_TEST)
>> +		return 0;
>> +
> 
> [Severity: High]
> Does this early return cause an IRQ disable depth leak?
> 
> Since ivpu_boot() skips the call to enable_irq() when IVPU_TEST_MODE_FW_TEST
> is enabled, it breaks the enable/disable symmetry.
> 
> Later, during teardown paths like ivpu_prepare_for_reset(), disable_irq()
> is called unconditionally:
> 
> drivers/accel/ivpu/ivpu_drv.c:ivpu_prepare_for_reset() {
>      ...
>      disable_irq(vdev->irq);
>      ...
> }
> 
> Calling disable_irq() without a matching enable_irq() increments the disable
> depth on each suspend/resume cycle. If the user dynamically disables FW_TEST
> mode via sysfs, subsequent enable_irq() calls will only decrement the
> accumulated depth by 1, leaving the physical interrupt permanently disabled.
> 
>>   	ret = ivpu_wait_for_ready(vdev);
>>   	if (ret) {
>>   		ivpu_err(vdev, "Failed to boot the firmware: %d\n", ret);
> 
Will be addressed in v2 patch.

      reply	other threads:[~2026-10-07 16:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-07 10:24 [PATCH] accel/ivpu: Improve IVPU_TEST_MODE_FW_TEST handling Andrzej Kacprowski
2026-10-07 10:38 ` sashiko-bot
2026-10-07 16:17   ` Andrzej Kacprowski [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=f3030543-45f3-4719-b8a9-4fd6226263e6@linux.intel.com \
    --to=andrzej.kacprowski@linux.intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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.