AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Christian König" <ckoenig.leichtzumerken@gmail.com>
To: YiPeng Chai <YiPeng.Chai@amd.com>, amd-gfx@lists.freedesktop.org
Cc: Hawking.Zhang@amd.com, Tao.Zhou1@amd.com, Candice.Li@amd.com,
	KevinYang.Wang@amd.com, Stanley.Yang@amd.com
Subject: Re: [PATCH 5/5] drm/amdgpu: add gpu reset check before page retirement thread runs
Date: Thu, 13 Jun 2024 12:21:21 +0200	[thread overview]
Message-ID: <a60b1b4c-7acb-4380-880b-072b23010134@gmail.com> (raw)
In-Reply-To: <20240613022504.81787-5-YiPeng.Chai@amd.com>



Am 13.06.24 um 04:25 schrieb YiPeng Chai:
> If gpu is recovering, clear all message reset flags
> in fifo and wait for gpu to complete recovery.
>
> Signed-off-by: YiPeng Chai <YiPeng.Chai@amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 12 ++++++++++++
>   1 file changed, 12 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
> index 341c9bd0d1a4..bf4f8d439ebe 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
> @@ -2982,6 +2982,18 @@ static int amdgpu_ras_page_retirement_thread(void *param)
>   
>   		atomic_dec(&con->page_retirement_req_cnt);
>   
> +		reinit_completion(&con->gpu_reset_completion);
> +
> +		if (amdgpu_in_reset(adev) || atomic_read(&con->in_recovery)) {

It's illegal to call amdgpu_in_reset() from outside of the hw specific 
backends.

When you want to make the code mutual exclusive with GPU resets you need 
to grab the reset lock.

Regards,
Christian.

> +			uint32_t reset;
> +
> +			amdgpu_ras_clear_poison_fifo_msg_reset_flag(adev, &reset);
> +
> +			if (!wait_for_completion_timeout(&con->gpu_reset_completion,
> +				msecs_to_jiffies(MAX_GPU_RESET_COMPLETION_TIME)))
> +				dev_err(adev->dev, "Waiting for GPU to complete reset timeout!\n");
> +		}
> +
>   #ifdef HAVE_KFIFO_PUT_NON_POINTER
>   		if (!amdgpu_ras_get_poison_req(adev, &poison_msg))
>   			continue;


  reply	other threads:[~2024-06-13 10:21 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-13  2:25 [PATCH 1/5] drm/amdgpu: add condition check for waking up thread YiPeng Chai
2024-06-13  2:25 ` [PATCH 2/5] drm/amdgpu: add threshold to interrupt waiting for DE data to be ready YiPeng Chai
2024-06-13  2:25 ` [PATCH 3/5] drm/amdgpu: clear all messages reset flags in fifo before gpu reset YiPeng Chai
2024-06-13  2:25 ` [PATCH 4/5] drm/amdgpu: wait for gpu to complete reset YiPeng Chai
2024-06-13 10:19   ` Christian König
2024-06-13  2:25 ` [PATCH 5/5] drm/amdgpu: add gpu reset check before page retirement thread runs YiPeng Chai
2024-06-13 10:21   ` Christian König [this message]
2024-06-13  8:11 ` [PATCH 1/5] drm/amdgpu: add condition check for waking up thread Lazar, Lijo

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=a60b1b4c-7acb-4380-880b-072b23010134@gmail.com \
    --to=ckoenig.leichtzumerken@gmail.com \
    --cc=Candice.Li@amd.com \
    --cc=Hawking.Zhang@amd.com \
    --cc=KevinYang.Wang@amd.com \
    --cc=Stanley.Yang@amd.com \
    --cc=Tao.Zhou1@amd.com \
    --cc=YiPeng.Chai@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    /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