From: "Lazar, Lijo" <lijo.lazar@amd.com>
To: Mario Limonciello <mario.limonciello@amd.com>,
amd-gfx@lists.freedesktop.org
Subject: Re: [PATCH v2] drm/amd: Set num IP blocks to 0 if discovery fails
Date: Tue, 10 Mar 2026 10:42:56 +0530 [thread overview]
Message-ID: <490e342a-a528-47f2-b9fb-d779e6fe89bb@amd.com> (raw)
In-Reply-To: <20260310022231.2838680-1-mario.limonciello@amd.com>
On 10-Mar-26 7:52 AM, Mario Limonciello wrote:
> If discovery has failed for any reason (such as no support for a block)
> then there is no need to unwind all the IP blocks in fini. In this
> condition there can actually be failures during the unwind too.
>
> Reset num_ip_blocks to zero during failure path.
>
> Suggested-by: Lijo Lazar <lijo.lazar@amd.com>
> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
This will do specifically for the ip block checks.
Wondering whether amdgpu_driver_unload_kms() also should be modified.
For ex: calling amdgpu_unregister_gpu_instance and
amdgpu_device_fini_hw() don't seem to be relevant if discovery fails.
Thanks,
Lijo
> ---
> v2:
> * Stop chasing NULL pointers (Lijo)
> drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> index bc6f714e8763a..042f24a0e10fb 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> @@ -2701,8 +2701,10 @@ static int amdgpu_device_ip_early_init(struct amdgpu_device *adev)
> break;
> default:
> r = amdgpu_discovery_set_ip_blocks(adev);
> - if (r)
> + if (r) {
> + adev->num_ip_blocks = 0;
> return r;
> + }
> break;
> }
>
prev parent reply other threads:[~2026-03-10 5:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-10 2:22 [PATCH v2] drm/amd: Set num IP blocks to 0 if discovery fails Mario Limonciello
2026-03-10 5:12 ` Lazar, Lijo [this message]
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=490e342a-a528-47f2-b9fb-d779e6fe89bb@amd.com \
--to=lijo.lazar@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=mario.limonciello@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.