Commit e043a35d authored by Sunil Khatri's avatar Sunil Khatri Committed by Alex Deucher
Browse files

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: default avatarSunil Khatri <sunil.khatri@amd.com>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent c8732c80
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -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 */