mirror of https://lore.kernel.org/lkml/
 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>,
	"Shashank Sharma" <shashank.sharma@amd.com>
Cc: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org,
	Hawking Zhang <Hawking.Zhang@amd.com>,
	Felix Kuehling <Felix.Kuehling@amd.com>,
	Lijo Lazar <lijo.lazar@amd.com>,
	Sunil Khatri <sunil.khatri@amd.com>
Subject: [PATCH] drm/amdgpu: add support of bios dump in devcoredump
Date: Tue, 26 Mar 2024 20:07:50 +0530	[thread overview]
Message-ID: <20240326143750.2292945-1-sunil.khatri@amd.com> (raw)

dump the bios binary in the devcoredump.

Signed-off-by: Sunil Khatri <sunil.khatri@amd.com>
---
 .../gpu/drm/amd/amdgpu/amdgpu_dev_coredump.c  | 20 +++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_dev_coredump.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_dev_coredump.c
index 44c5da8aa9ce..f33963d777eb 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_dev_coredump.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_dev_coredump.c
@@ -132,6 +132,26 @@ amdgpu_devcoredump_read(char *buffer, loff_t offset, size_t count,
 	drm_printf(&p, "Faulty page starting at address: 0x%016llx\n", fault_info->addr);
 	drm_printf(&p, "Protection fault status register: 0x%x\n\n", fault_info->status);
 
+	/* Dump BIOS */
+	if (coredump->adev->bios && coredump->adev->bios_size) {
+		int i = 0;
+
+		drm_printf(&p, "BIOS Binary dump\n");
+		drm_printf(&p, "Valid BIOS  Size:%d bytes type:%s\n",
+			   coredump->adev->bios_size,
+			   coredump->adev->is_atom_fw ?
+			   "Atom bios":"Non Atom Bios");
+
+		while (i < coredump->adev->bios_size) {
+			/* Printing 15 bytes in a line */
+			if (i % 15 == 0)
+				drm_printf(&p, "\n");
+			drm_printf(&p, "0x%x \t", coredump->adev->bios[i]);
+			i++;
+		}
+		drm_printf(&p, "\n");
+	}
+
 	/* Add ring buffer information */
 	drm_printf(&p, "Ring buffer information\n");
 	for (int i = 0; i < coredump->adev->num_rings; i++) {
-- 
2.34.1


             reply	other threads:[~2024-03-26 14:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-26 14:37 Sunil Khatri [this message]
2024-03-26 16:53 ` Alex Deucher
2024-03-26 17:34   ` Khatri, Sunil

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=20240326143750.2292945-1-sunil.khatri@amd.com \
    --to=sunil.khatri@amd.com \
    --cc=Felix.Kuehling@amd.com \
    --cc=Hawking.Zhang@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=lijo.lazar@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=shashank.sharma@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®