summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm
diff options
context:
space:
mode:
authorSunil Khatri <sunil.khatri@amd.com>2024-04-16 16:56:23 +0530
committerAlex Deucher <alexander.deucher@amd.com>2024-04-26 17:22:39 -0400
commite043a35dc244b72809cf3a1b8ff315dcb941c63a (patch)
treeed2e4d6b221933e7bd66e7c3543da2a0e4cdfa23 /drivers/gpu/drm
parentc8732c80debb276c36de395a1a8f40c33cf10830 (diff)
downloadlinux-stable-e043a35dc244b72809cf3a1b8ff315dcb941c63a.tar.gz
linux-stable-e043a35dc244b72809cf3a1b8ff315dcb941c63a.tar.bz2
linux-stable-e043a35dc244b72809cf3a1b8ff315dcb941c63a.zip
drm/amdgpu: dump ip state before reset for each ip
Invoke the dump_ip_state function for each ip before the asic resets and save the register values for debugging via devcoredump. Signed-off-by: Sunil Khatri <sunil.khatri@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_device.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index f3b7cb18fd46..f8a34db5d9e3 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -5353,6 +5353,7 @@ int amdgpu_do_asic_reset(struct list_head *device_list_handle,
struct amdgpu_device *tmp_adev = NULL;
bool need_full_reset, skip_hw_reset, vram_lost = false;
int r = 0;
+ uint32_t i;
/* Try reset handler method first */
tmp_adev = list_first_entry(device_list_handle, struct amdgpu_device,
@@ -5361,6 +5362,12 @@ int amdgpu_do_asic_reset(struct list_head *device_list_handle,
if (!test_bit(AMDGPU_SKIP_COREDUMP, &reset_context->flags))
amdgpu_reset_reg_dumps(tmp_adev);
+ /* Trigger ip dump before we reset the asic */
+ for (i = 0; i < tmp_adev->num_ip_blocks; i++)
+ if (tmp_adev->ip_blocks[i].version->funcs->dump_ip_state)
+ tmp_adev->ip_blocks[i].version->funcs->dump_ip_state(
+ (void *)tmp_adev);
+
reset_context->reset_device_list = device_list_handle;
r = amdgpu_reset_perform_reset(tmp_adev, reset_context);
/* If reset handler not implemented, continue; otherwise return */