All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sunil Khatri <sunil.khatri@amd.com>
To: "Alex Deucher" <alexander.deucher@amd.com>,
	"Christian König" <christian.koenig@amd.com>
Cc: amd-gfx@lists.freedesktop.org, Sunil Khatri <sunil.khatri@amd.com>
Subject: [PATCH v5 5/6] drm/amdgpu: dump ip state before reset for each ip
Date: Wed, 17 Apr 2024 15:08:08 +0530	[thread overview]
Message-ID: <20240417093809.168002-5-sunil.khatri@amd.com> (raw)
In-Reply-To: <20240417093809.168002-1-sunil.khatri@amd.com>

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>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 7 +++++++
 1 file changed, 7 insertions(+)

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 */
-- 
2.34.1


  parent reply	other threads:[~2024-04-17  9:38 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-17  9:38 [PATCH v5 1/6] drm/amdgpu: add prototype for ip dump Sunil Khatri
2024-04-17  9:38 ` [PATCH v5 2/6] drm/amdgpu: add support of gfx10 register dump Sunil Khatri
2024-04-17 15:51   ` Alex Deucher
2024-04-17 16:01     ` Lazar, Lijo
2024-04-17 16:11       ` Khatri, Sunil
2024-04-17 16:23         ` Lazar, Lijo
2024-04-17 16:51           ` Alex Deucher
2024-04-17 17:01             ` Khatri, Sunil
2024-04-17 17:30               ` Alex Deucher
2024-04-18  6:12                 ` Christian König
2024-04-17  9:38 ` [PATCH v5 3/6] drm/amdgpu: add protype for print ip state Sunil Khatri
2024-04-17 15:48   ` Alex Deucher
2024-04-17  9:38 ` [PATCH v5 4/6] drm/amdgpu: add support for gfx v10 print Sunil Khatri
2024-04-17 15:52   ` Alex Deucher
2024-04-17  9:38 ` Sunil Khatri [this message]
2024-04-17 15:52   ` [PATCH v5 5/6] drm/amdgpu: dump ip state before reset for each ip Alex Deucher
2024-04-17  9:38 ` [PATCH v5 6/6] drm/amdgpu: add ip dump for each ip in devcoredump Sunil Khatri
2024-04-17 15:53   ` Alex Deucher
2024-04-17 15:45 ` [PATCH v5 1/6] drm/amdgpu: add prototype for ip dump Alex Deucher
2024-04-18  8:45   ` Christian König

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=20240417093809.168002-5-sunil.khatri@amd.com \
    --to=sunil.khatri@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=christian.koenig@amd.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.