drm/amdgpu: Skip put_reset_domain if it doesnt exist
Subsystems (2)
PATCH 1/1 drm/amdgpu: Skip put_reset_domain if it doesnt exist
--- drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c +2 -1
@@ -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);
Signature · 1 line
2.25.1
Quoted 2 lines · Vignesh Chander
Change-Id Ifd6121fb94db3fadaa1dee61d35699abe1259409Signed-off-by Vignesh Chander <[email protected]>
Please remove the Change-Id and provide commit message body.
Quoted 18 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c +2
-1@@ -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);
Signature · 1 line
Hamza
Christian König
maintainerAm 28.09.22 um 19:37 schrieb Vignesh Chander:
Quoted 11 lines
Change-Id Ifd6121fb94db3fadaa1dee61d35699abe1259409Signed-off-by Vignesh Chander <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c +0
-0
drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c static void amdgpu_xgmi_hive_release(struct kobject *kobj) · line 221
Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c +2
-1@@ -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);
As general coding style rule _put functions are usually NULL pointer tolerant. So this shouldn't be necessary.
If that really is necessary then please adjust the amdgpu_reset_put_reset_domain() function instead.
Christian.
Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c +0
-0hive->reset_domain =NULL ;mutex_destroy (&hive->hive_lock);
[AMD Official Use Only - General]
Please add description like under sriov xgmi configuration , the hive reset is handled by host driver , hive->reset_domain is not been in initialized so need to skip it .
Regards
Shaoyun.liu
-----Original Message-----
From: Chander, Vignesh <[email protected]>
Sent: Wednesday, September 28, 2022 1:38 PM
To: [email protected]
Cc: Liu, Shaoyun <[email protected]>; Chander, Vignesh <[email protected]>
Subject: [PATCH] drm/amdgpu: Skip put_reset_domain if it doesnt exist
--- drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c +2 -1
@@ -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);
--
2.25.1