[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230711213501.526237-3-andrealmeid@igalia.com>
Date: Tue, 11 Jul 2023 18:34:57 -0300
From: André Almeida <andrealmeid@...lia.com>
To: dri-devel@...ts.freedesktop.org, amd-gfx@...ts.freedesktop.org,
linux-kernel@...r.kernel.org
Cc: kernel-dev@...lia.com, alexander.deucher@....com,
christian.koenig@....com, pierre-eric.pelloux-prayer@....com,
'Marek Olšák' <maraeo@...il.com>,
Samuel Pitoiset <samuel.pitoiset@...il.com>,
Bas Nieuwenhuizen <bas@...nieuwenhuizen.nl>,
Timur Kristóf <timur.kristof@...il.com>,
michel.daenzer@...lbox.org,
André Almeida <andrealmeid@...lia.com>
Subject: [PATCH 2/6] drm/amdgpu: Mark contexts guilty for causing soft recoveries
If a DRM fence is set to -ENODATA, that means that this context was a
cause of a soft reset, but is never marked as guilty. Flag it as guilty
and log to user that this context won't accept more submissions.
Signed-off-by: André Almeida <andrealmeid@...lia.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
index 0dc9c655c4fb..fe8e47d063da 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
@@ -459,6 +459,12 @@ int amdgpu_ctx_get_entity(struct amdgpu_ctx *ctx, u32 hw_ip, u32 instance,
ctx_entity = &ctx->entities[hw_ip][ring]->entity;
r = drm_sched_entity_error(ctx_entity);
if (r) {
+ if (r == -ENODATA) {
+ DRM_ERROR("%s (%d) context caused a reset,"
+ "marking it guilty and refusing new submissions.\n",
+ current->comm, current->pid);
+ atomic_set(&ctx->guilty, 1);
+ }
DRM_DEBUG("error entity %p\n", ctx_entity);
return r;
}
--
2.41.0
Powered by blists - more mailing lists