* [PATCH] drm/amdgpu: Skip discovery dump when topology is unavailable
@ 2026-03-19 10:59 Srinivasan Shanmugam
2026-03-19 12:26 ` Christian König
0 siblings, 1 reply; 2+ messages in thread
From: Srinivasan Shanmugam @ 2026-03-19 10:59 UTC (permalink / raw)
To: Christian König, Alex Deucher
Cc: amd-gfx, Srinivasan Shanmugam, Pierre-Eric Pelloux-Prayer
When generating a devcoredump, amdgpu_discovery_dump() prints the IP
discovery topology.
The function already needs to handle the case where
adev->discovery.ip_top is NULL to avoid a crash.
Currently, the code prints a section header and an additional message
when the topology is unavailable.
However, for platforms where discovery is not used, this section is not
expected to be present. Printing an extra message adds unnecessary
output.
Simplify this by skipping the entire section when ip_top is NULL.
The NULL check is kept to avoid a crash, but no output is generated when
the discovery topology is unavailable.
Cc: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Cc: Christian König <christian.koenig@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
index 6be1f971a31a..5a4e63e1ad93 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
@@ -1422,15 +1422,13 @@ void amdgpu_discovery_dump(struct amdgpu_device *adev, struct drm_printer *p)
struct ip_hw_instance *ip_inst;
int i = 0, j;
- drm_printf(p, "\nHW IP Discovery\n");
-
- if (!ip_top) {
- drm_printf(p, "ip discovery topology unavailable\n");
+ if (!ip_top)
return;
- }
die_kset = &ip_top->die_kset;
+ drm_printf(p, "\nHW IP Discovery\n");
+
spin_lock(&die_kset->list_lock);
list_for_each(el_die, &die_kset->list) {
drm_printf(p, "die %d\n", i++);
--
2.34.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] drm/amdgpu: Skip discovery dump when topology is unavailable
2026-03-19 10:59 [PATCH] drm/amdgpu: Skip discovery dump when topology is unavailable Srinivasan Shanmugam
@ 2026-03-19 12:26 ` Christian König
0 siblings, 0 replies; 2+ messages in thread
From: Christian König @ 2026-03-19 12:26 UTC (permalink / raw)
To: Srinivasan Shanmugam, Alex Deucher; +Cc: amd-gfx, Pierre-Eric Pelloux-Prayer
On 3/19/26 11:59, Srinivasan Shanmugam wrote:
> When generating a devcoredump, amdgpu_discovery_dump() prints the IP
> discovery topology.
>
> The function already needs to handle the case where
> adev->discovery.ip_top is NULL to avoid a crash.
>
> Currently, the code prints a section header and an additional message
> when the topology is unavailable.
>
> However, for platforms where discovery is not used, this section is not
> expected to be present. Printing an extra message adds unnecessary
> output.
>
> Simplify this by skipping the entire section when ip_top is NULL.
>
> The NULL check is kept to avoid a crash, but no output is generated when
> the discovery topology is unavailable.
>
> Cc: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
> Cc: Christian König <christian.koenig@amd.com>
> Cc: Alex Deucher <alexander.deucher@amd.com>
> Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 8 +++-----
> 1 file changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
> index 6be1f971a31a..5a4e63e1ad93 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
> @@ -1422,15 +1422,13 @@ void amdgpu_discovery_dump(struct amdgpu_device *adev, struct drm_printer *p)
> struct ip_hw_instance *ip_inst;
> int i = 0, j;
>
> - drm_printf(p, "\nHW IP Discovery\n");
> -
> - if (!ip_top) {
> - drm_printf(p, "ip discovery topology unavailable\n");
> + if (!ip_top)
> return;
> - }
>
> die_kset = &ip_top->die_kset;
>
> + drm_printf(p, "\nHW IP Discovery\n");
> +
> spin_lock(&die_kset->list_lock);
> list_for_each(el_die, &die_kset->list) {
> drm_printf(p, "die %d\n", i++);
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-03-19 12:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-19 10:59 [PATCH] drm/amdgpu: Skip discovery dump when topology is unavailable Srinivasan Shanmugam
2026-03-19 12:26 ` Christian König
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox