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 <[email protected]> > Cc: Christian König <[email protected]> > Cc: Alex Deucher <[email protected]> > Signed-off-by: Srinivasan Shanmugam <[email protected]>
Reviewed-by: Christian König <[email protected]> > --- > 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++);
