From: "Christian König" <christian.koenig@amd.com>
To: "André Almeida" <andrealmeid@igalia.com>,
"Alex Deucher" <alexander.deucher@amd.com>,
"Xinhui Pan" <Xinhui.Pan@amd.com>,
amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org, kernel-dev@igalia.com,
siqueira@igalia.com
Subject: Re: [PATCH 3/3] drm/amdgpu: Trigger a wedged event for every type of reset
Date: Thu, 20 Feb 2025 10:22:27 +0100 [thread overview]
Message-ID: <9b0a4a13-9d60-49a5-9166-6bb714f4dbfd@amd.com> (raw)
In-Reply-To: <20250219213517.281556-4-andrealmeid@igalia.com>
Am 19.02.25 um 22:35 schrieb André Almeida:
> Instead of only triggering a wedged event for complete GPU resets,
> trigger for all types, like soft resets and ring resets. Regardless of
> the reset, it's useful for userspace to know that it happened because
> the kernel will reject further submissions from that app.
>
> Signed-off-by: André Almeida <andrealmeid@igalia.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 3 ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_job.c | 16 +++++++++-------
> 2 files changed, 9 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> index 24ba52d76045..36738c1a5b59 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> @@ -6123,9 +6123,6 @@ int amdgpu_device_gpu_recover(struct amdgpu_device *adev,
>
> atomic_set(&adev->reset_domain->reset_res, r);
>
> - if (!r)
> - drm_dev_wedged_event(adev_to_drm(adev), DRM_WEDGE_RECOVERY_NONE);
> -
Feel free to add my rb to patch #1 and #2, but this here is a bad idea.
We have resets which are not triggered by a submission timeout, but rather because of RAS (for example) and those would now not be raised any more.
Regards,
Christian.
> return r;
> }
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
> index 698e5799e542..1082b957e7b1 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
> @@ -91,8 +91,7 @@ static enum drm_gpu_sched_stat amdgpu_job_timedout(struct drm_sched_job *s_job)
> struct amdgpu_job *job = to_amdgpu_job(s_job);
> struct amdgpu_task_info *ti;
> struct amdgpu_device *adev = ring->adev;
> - int idx;
> - int r;
> + int idx, ret = 0;
>
> if (!drm_dev_enter(adev_to_drm(adev), &idx)) {
> dev_info(adev->dev, "%s - device unplugged skipping recovery on scheduler:%s",
> @@ -141,8 +140,8 @@ static enum drm_gpu_sched_stat amdgpu_job_timedout(struct drm_sched_job *s_job)
> * we'll fall back to full GPU reset.
> */
> drm_sched_wqueue_stop(&ring->sched);
> - r = amdgpu_ring_reset(ring, job->vmid);
> - if (!r) {
> + ret = amdgpu_ring_reset(ring, job->vmid);
> + if (!ret) {
> if (amdgpu_ring_sched_ready(ring))
> drm_sched_stop(&ring->sched, s_job);
> atomic_inc(&ring->adev->gpu_reset_counter);
> @@ -170,9 +169,9 @@ static enum drm_gpu_sched_stat amdgpu_job_timedout(struct drm_sched_job *s_job)
> */
> set_bit(AMDGPU_SKIP_COREDUMP, &reset_context.flags);
>
> - r = amdgpu_device_gpu_recover(ring->adev, job, &reset_context);
> - if (r)
> - dev_err(adev->dev, "GPU Recovery Failed: %d\n", r);
> + ret = amdgpu_device_gpu_recover(ring->adev, job, &reset_context);
> + if (ret)
> + dev_err(adev->dev, "GPU Recovery Failed: %d\n", ret);
> } else {
> drm_sched_suspend_timeout(&ring->sched);
> if (amdgpu_sriov_vf(adev))
> @@ -180,6 +179,9 @@ static enum drm_gpu_sched_stat amdgpu_job_timedout(struct drm_sched_job *s_job)
> }
>
> exit:
> + if (!ret)
> + drm_dev_wedged_event(adev_to_drm(adev), DRM_WEDGE_RECOVERY_NONE);
> +
> drm_dev_exit(idx);
> return DRM_GPU_SCHED_STAT_NOMINAL;
> }
prev parent reply other threads:[~2025-02-20 9:22 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-19 21:35 [PATCH 0/3] drm/amdgpu: Small reset improvements André Almeida
2025-02-19 21:35 ` [PATCH 1/3] drm/amdgpu: Log the creation of a coredump file André Almeida
2025-02-24 11:18 ` Michel Dänzer
2025-02-19 21:35 ` [PATCH 2/3] drm/amdgpu: Log after a successful ring reset André Almeida
2025-02-19 21:35 ` [PATCH 3/3] drm/amdgpu: Trigger a wedged event for every type of reset André Almeida
2025-02-20 9:22 ` Christian König [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=9b0a4a13-9d60-49a5-9166-6bb714f4dbfd@amd.com \
--to=christian.koenig@amd.com \
--cc=Xinhui.Pan@amd.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=andrealmeid@igalia.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=kernel-dev@igalia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=siqueira@igalia.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
all inboxes | Powered by JetHome®