Skip to contentSkip to conversation

drm/amdgpu: Skip put_reset_domain if it doesnt exist

PATCH In review Vignesh Chander 4 participants 4 messages Sep 28, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu: Skip put_reset_domain if it doesnt exist

Change-Id Ifd6121fb94db3fadaa1dee61d35699abe1259409
---
 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
index 47159e9a0884..80fb6ef929e5 100644
@@ -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
#1 lore raw
Quoted 2 lines · Vignesh Chander
Change-Id Ifd6121fb94db3fadaa1dee61d35699abe1259409

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
index 47159e9a0884..80fb6ef929e5 100644
@@ -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
maintainer
#2 lore raw
In reply to Vignesh Chander

Am 28.09.22 um 19:37 schrieb Vignesh Chander:

Quoted 11 lines
Change-Id Ifd6121fb94db3fadaa1dee61d35699abe1259409
---
  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
index 47159e9a0884..80fb6ef929e5 100644

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 -0
  	hive->reset_domain = NULL;
 
  	mutex_destroy(&hive->hive_lock);
#3 lore raw
In reply to Vignesh Chander

[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

Change-Id Ifd6121fb94db3fadaa1dee61d35699abe1259409
---
 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
index 47159e9a0884..80fb6ef929e5 100644
@@ -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