dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
To: Jeffrey Hugo <quic_jhugo@quicinc.com>, dri-devel@lists.freedesktop.org
Cc: oded.gabbay@gmail.com, "Wachowski, Karol" <karol.wachowski@intel.com>
Subject: Re: [PATCH 4/7] accel/ivpu: Gracefully shutdown NPU before reset
Date: Tue, 6 Feb 2024 13:22:25 +0100	[thread overview]
Message-ID: <6f102565-70a0-456d-97fb-43af8c9f0fb9@linux.intel.com> (raw)
In-Reply-To: <db4a3b14-3fc1-4687-ba18-a52f9bc0db82@linux.intel.com>

On 05.02.2024 09:39, Jacek Lawrynowicz wrote:
> On 26.01.2024 19:23, Jeffrey Hugo wrote:
>> On 1/26/2024 5:28 AM, Jacek Lawrynowicz wrote:
>>> From: "Wachowski, Karol" <karol.wachowski@intel.com>
>>>
>>> Replace forceful disable of power domains with requests to disable
>>> TOP NOC CPU_CTRL and HOSTIF_L2CACHE through QREQN.
>>>
>>> In case of failure retry multiple times following HAS sequence of
>>> checking both QACCEPN and QDENYN registers.
>>>
>>> This fixes VPU hangs with PCODE released in January 2024 onwards.
>>>
>>> Fixes: 3f7c0634926d ("accel/ivpu/37xx: Fix hangs related to MMIO reset")
>>> Signed-off-by: Wachowski, Karol <karol.wachowski@intel.com>
>>> Signed-off-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
>>> ---
>>>   drivers/accel/ivpu/ivpu_hw_37xx.c | 122 +++++++++++++++---------------
>>>   1 file changed, 60 insertions(+), 62 deletions(-)
>>>

...

>>>   static void ivpu_boot_no_snoop_enable(struct ivpu_device *vdev)
>>>   {
>>>       u32 val = REGV_RD32(VPU_37XX_HOST_IF_TCU_PTW_OVERRIDES);
>>> @@ -618,19 +617,18 @@ static int ivpu_hw_37xx_info_init(struct ivpu_device *vdev)
>>>     static int ivpu_hw_37xx_reset(struct ivpu_device *vdev)
>>>   {
>>> -    int ret = 0;
>>> +    int retries = 100;
>>>   -    if (ivpu_boot_pwr_domain_disable(vdev)) {
>>> -        ivpu_err(vdev, "Failed to disable power domain\n");
>>> -        ret = -EIO;
>>> -    }
>>> +    while (ivpu_boot_host_ss_top_noc_cpu_ctrl_disable(vdev) && --retries > 0)
>>> +        ivpu_warn(vdev, "Retrying to disable CPU control, retries left: %d\n", retries);
>>>   -    if (ivpu_pll_disable(vdev)) {
>>> -        ivpu_err(vdev, "Failed to disable PLL\n");
>>> -        ret = -EIO;
>>> -    }
>>> +    while (ivpu_boot_host_ss_top_noc_hostif_l2cache_disable(vdev) && --retries > 0)
>>> +        ivpu_warn(vdev, "Retrying to disable HostIf L2 Cache, retries left: %d\n", retries);
>>>   -    return ret;
>>> +    while (ivpu_pll_disable(vdev) && --retries > 0)
>>> +        ivpu_warn(vdev, "Retrying to disable PLL, retries left: %d\n", retries);
>>> +
>>> +    return retries > 0 ? 0 : -EIO;
>>
>> It seems weird that retries is never reset between operations.  Why is that?
> 
> This is intentional.
> Retries are shared among all operations as we don't exacly know max number of retries for each of them.

We found a better solution to our stability issues. I will drop this patch and submit a new one.

  reply	other threads:[~2024-02-06 12:22 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-26 12:27 [PATCH 0/7] accel/ivpu fixes for 6.8-rc3 Jacek Lawrynowicz
2024-01-26 12:27 ` [PATCH 1/7] accel/ivpu: Force snooping for MMU writes Jacek Lawrynowicz
2024-01-26 18:13   ` Jeffrey Hugo
2024-01-26 12:27 ` [PATCH 2/7] accel/ivpu: Correct MMU queue size checking functions Jacek Lawrynowicz
2024-01-26 18:19   ` Jeffrey Hugo
2024-01-26 12:28 ` [PATCH 3/7] accel/ivpu: Disable d3hot_delay on all NPU generations Jacek Lawrynowicz
2024-01-26 18:20   ` Jeffrey Hugo
2024-01-26 12:28 ` [PATCH 4/7] accel/ivpu: Gracefully shutdown NPU before reset Jacek Lawrynowicz
2024-01-26 18:23   ` Jeffrey Hugo
2024-02-05  8:39     ` Jacek Lawrynowicz
2024-02-06 12:22       ` Jacek Lawrynowicz [this message]
2024-01-26 12:28 ` [PATCH 5/7] accel/ivpu/40xx: Enable D0i3 message Jacek Lawrynowicz
2024-01-26 18:24   ` Jeffrey Hugo
2024-02-05  8:27     ` Jacek Lawrynowicz
2024-01-26 12:28 ` [PATCH 6/7] accel/ivpu/40xx: Stop passing SKU boot parameters to FW Jacek Lawrynowicz
2024-01-26 18:25   ` Jeffrey Hugo
2024-01-26 12:28 ` [PATCH 7/7] accel/ivpu: Add job status for jobs aborted by the driver Jacek Lawrynowicz
2024-01-26 18:27   ` Jeffrey Hugo
2024-02-06 12:42 ` [PATCH 0/7] accel/ivpu fixes for 6.8-rc3 Jacek Lawrynowicz

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=6f102565-70a0-456d-97fb-43af8c9f0fb9@linux.intel.com \
    --to=jacek.lawrynowicz@linux.intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=karol.wachowski@intel.com \
    --cc=oded.gabbay@gmail.com \
    --cc=quic_jhugo@quicinc.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).