From: "Christian König" <christian.koenig@amd.com>
To: Vignesh Chander <Vignesh.Chander@amd.com>, amd-gfx@lists.freedesktop.org
Cc: Shaoyun.Liu@amd.com
Subject: Re: [PATCH] drm/amdgpu: Skip put_reset_domain if it doesnt exist
Date: Wed, 28 Sep 2022 20:27:05 +0200 [thread overview]
Message-ID: <f1e96940-b437-e096-4e94-a2537998fde1@amd.com> (raw)
In-Reply-To: <20220928182229.14683-1-Vignesh.Chander@amd.com>
Am 28.09.22 um 20:22 schrieb Vignesh Chander:
> For xgmi sriov, the reset is handled by host driver and hive->reset_domain
> is not initialized so need to check if it exists before doing a put.
Once more: General practice is to make the *_put_*() functions NULL
tolerant.
So rather make this than this patch here.
Regards,
Christian.
> Signed-off-by: Vignesh Chander <Vignesh.Chander@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c
> index 47159e9a0884..80fb6ef929e5 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c
> @@ -217,7 +217,8 @@ static void amdgpu_xgmi_hive_release(struct kobject *kobj)
> struct amdgpu_hive_info *hive = container_of(
> kobj, struct amdgpu_hive_info, kobj);
>
> - amdgpu_reset_put_reset_domain(hive->reset_domain);
> + if (hive->reset_domain)
> + amdgpu_reset_put_reset_domain(hive->reset_domain);
> hive->reset_domain = NULL;
>
> mutex_destroy(&hive->hive_lock);
next prev parent reply other threads:[~2022-09-28 18:27 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-28 18:22 [PATCH] drm/amdgpu: Skip put_reset_domain if it doesnt exist Vignesh Chander
2022-09-28 18:27 ` Christian König [this message]
-- strict thread matches above, loose matches on Subject: below --
2022-09-28 19:03 Vignesh Chander
2022-09-28 22:02 ` Liu, Shaoyun
2022-09-28 17:43 Vignesh Chander
2022-09-28 17:45 ` Christian König
2022-09-28 18:11 ` Chander, Vignesh
2022-09-28 17:37 Vignesh Chander
2022-09-28 17:40 ` Hamza Mahfooz
2022-09-28 17:44 ` Christian König
2022-09-28 17:44 ` Liu, Shaoyun
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=f1e96940-b437-e096-4e94-a2537998fde1@amd.com \
--to=christian.koenig@amd.com \
--cc=Shaoyun.Liu@amd.com \
--cc=Vignesh.Chander@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
/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