Skip to contentSkip to conversation

drm/amdgpu: Skip put_reset_domain if it doesnt exist

PATCH In review Vignesh Chander 2 participants 3 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

For sriov, the reset domain is no longer created so need to check if it exists before doing a put.

---
 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

Am 28.09.22 um 19:43 schrieb Vignesh Chander:

Quoted 2 lines

For sriov, the reset domain is no longer created so need to check if it exists before doing a put.

Why is the reset domain no longer created for SRIOV?

Regards,
Christian.

Quoted 19 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);
#2 lore raw

[AMD Official Use Only - General]

Hi Christian,

It is because the host driver handles the reset for xgmi sriov case. I will update the commit body as

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.

Regards,

VIGNESH CHANDER
Senior Software Development Engineer  |  AMD SW GPU Virtualization
----------------------------------------------------------------------------------------------------------------------------------
1 Commerce Valley Dr E, Markham, ON L3T 7X6, Canada

-----Original Message-----
From: Christian König <[email protected]>
Sent: Wednesday, September 28, 2022 1:45 PM
To: Chander, Vignesh <[email protected]>; [email protected]
Cc: Liu, Shaoyun <[email protected]>
Subject: Re: [PATCH] drm/amdgpu: Skip put_reset_domain if it doesnt exist

Am 28.09.22 um 19:43 schrieb Vignesh Chander:

Quoted 2 lines

For sriov, the reset domain is no longer created so need to check if it exists before doing a put.

Why is the reset domain no longer created for SRIOV?

Regards,
Christian.

Quoted 19 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);