Skip to content

Commit 5e59295

Browse files
amd-sukhatrialexdeucher
authored andcommitted
drm/amdgpu: add ring timeout information in devcoredump
Add ring timeout related information in the amdgpu devcoredump file for debugging purposes. During the gpu recovery process the registered call is triggered and add the debug information in data file created by devcoredump framework under the directory /sys/class/devcoredump/devcdx/ Signed-off-by: Sunil Khatri <sunil.khatri@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent 2bdebcb commit 5e59295

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_reset.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,13 @@ amdgpu_devcoredump_read(char *buffer, loff_t offset, size_t count,
196196
coredump->reset_task_info.process_name,
197197
coredump->reset_task_info.pid);
198198

199+
if (coredump->ring) {
200+
drm_printf(&p, "\nRing timed out details\n");
201+
drm_printf(&p, "IP Type: %d Ring Name: %s\n",
202+
coredump->ring->funcs->type,
203+
coredump->ring->name);
204+
}
205+
199206
if (coredump->reset_vram_lost)
200207
drm_printf(&p, "VRAM is lost due to GPU reset!\n");
201208
if (coredump->adev->reset_info.num_regs) {
@@ -220,6 +227,8 @@ void amdgpu_coredump(struct amdgpu_device *adev, bool vram_lost,
220227
{
221228
struct amdgpu_coredump_info *coredump;
222229
struct drm_device *dev = adev_to_drm(adev);
230+
struct amdgpu_job *job = reset_context->job;
231+
struct drm_sched_job *s_job;
223232

224233
coredump = kzalloc(sizeof(*coredump), GFP_NOWAIT);
225234

@@ -241,6 +250,11 @@ void amdgpu_coredump(struct amdgpu_device *adev, bool vram_lost,
241250
}
242251
}
243252

253+
if (job) {
254+
s_job = &job->base;
255+
coredump->ring = to_amdgpu_ring(s_job->sched);
256+
}
257+
244258
coredump->adev = adev;
245259

246260
ktime_get_ts64(&coredump->reset_time);

drivers/gpu/drm/amd/amdgpu/amdgpu_reset.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ struct amdgpu_coredump_info {
9797
struct amdgpu_task_info reset_task_info;
9898
struct timespec64 reset_time;
9999
bool reset_vram_lost;
100+
struct amdgpu_ring *ring;
100101
};
101102
#endif
102103

0 commit comments

Comments
 (0)