Skip to contentSkip to conversation

drm/amdgpu: kfd_pre_reset outside req_full_gpu cause sriov hang

PATCH In review wentalou 2 participants 4 messages Dec 7, 2018 – Dec 11, 2018 3 messages not in the archive

Subsystems (2)
lore
Share & tools
lore

wentalou

author
#0 lore raw

PATCH 1/1 drm/amdgpu: kfd_pre_reset outside req_full_gpu cause sriov hang

XGMI hive put kfd_pre_reset into amdgpu_device_lock_adev, but outside req_full_gpu of sriov.
It would make sriov hang during reset.

Change-Id I5b3e2a42c77b3b9635419df4470d021df7be34d1
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +6 -4
index ef36cc5..659dd40 100644
@@ -3474,14 +3474,16 @@ static void amdgpu_device_lock_adev(struct amdgpu_device *adev)
 	mutex_lock(&adev->lock_reset);
 	atomic_inc(&adev->gpu_reset_counter);
 	adev->in_gpu_reset = 1;
-	/* Block kfd */
-	amdgpu_amdkfd_pre_reset(adev);
+	/* Block kfd: SRIOV would do it separately */
+	if (!amdgpu_sriov_vf(adev))
+                amdgpu_amdkfd_pre_reset(adev);
 }
 
 static void amdgpu_device_unlock_adev(struct amdgpu_device *adev)
 {
-	/*unlock kfd */
-	amdgpu_amdkfd_post_reset(adev);
+	/*unlock kfd: SRIOV would do it separately */
+	if (!amdgpu_sriov_vf(adev))
+                amdgpu_amdkfd_post_reset(adev);
 	amdgpu_vf_error_trans_all(adev);
 	adev->in_gpu_reset = 0;
 	mutex_unlock(&adev->lock_reset);
Signature · 6 lines
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 1544162942-17349-1-git-send-email-Wentao.Lou-5C7GfCeVMHo@public.gmane.org

#2 lore raw

But KFD still need to be notified during reset , the pre_reset call to KFD will let KFD have a chance to suspend all the running process queues. Was the reset works normally on SRIOV before the refactor change for XGMI support ? We shouldn't change the logic .

Regards
shaoyun.liu

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of wentalou
Sent: Friday, December 7, 2018 1:09 AM
To: [email protected]
Cc: Lou, Wentao <[email protected]>
Subject: [PATCH] drm/amdgpu: kfd_pre_reset outside req_full_gpu cause sriov hang

XGMI hive put kfd_pre_reset into amdgpu_device_lock_adev, but outside req_full_gpu of sriov. It would make sriov hang during reset.

Change-Id I5b3e2a42c77b3b9635419df4470d021df7be34d1
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +6 -5
index ef36cc5..659dd40 100644
@@ -3474,14 +3474,16 @@ static void amdgpu_device_lock_adev(struct amdgpu_device *adev)
 	mutex_lock(&adev->lock_reset);
 	atomic_inc(&adev->gpu_reset_counter);
 	adev->in_gpu_reset = 1;
-	/* Block kfd */
-	amdgpu_amdkfd_pre_reset(adev);
+	/* Block kfd: SRIOV would do it separately */
+	if (!amdgpu_sriov_vf(adev))
+                amdgpu_amdkfd_pre_reset(adev);
 }
 
 static void amdgpu_device_unlock_adev(struct amdgpu_device *adev)  {
-	/*unlock kfd */
-	amdgpu_amdkfd_post_reset(adev);
+	/*unlock kfd: SRIOV would do it separately */
+	if (!amdgpu_sriov_vf(adev))
+                amdgpu_amdkfd_post_reset(adev);
 	amdgpu_vf_error_trans_all(adev);
 	adev->in_gpu_reset = 0;
 	mutex_unlock(&adev->lock_reset);
--

2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): BN4PR12MB0882CB80C6E0194436444AD4F4A50-aH9FTdWx9BYw01zZLexVOwdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org

#4 lore raw

Sriov should not call amdgpu_amdkfd_pre_reset inside amdgpu_device_lock_adev,
either amdgpu_amdkfd_post_reset inside amdgpu_device_unlock_adev.
In branch amd-staging-dkms-4.18, sriov already called amdgpu_amdkfd_pre_reset and amdgpu_amdkfd_post_reset inside amdgpu_device_reset_sriov. There 2 functions needed to be inside sriov's amdgpu_virt_request_full_gpu, or it would cause sriov hang. amdgpu_amdkfd_pre_reset inside amdgpu_device_lock_adev was duplicated for sriov, and caused cause sriov hang when entering amdgpu_device_lock_adev. That's the reason to add " if (!amdgpu_sriov_vf(adev))" based on branch amd-staging-dkms-4.18.

BR,
Wentao

-----Original Message-----
From: Liu, Shaoyun <[email protected]>
Sent: Tuesday, December 11, 2018 12:10 AM
To: Lou, Wentao <[email protected]>; [email protected]; Grodzovsky, Andrey <[email protected]>; Kuehling, Felix <[email protected]>
Cc: Lou, Wentao <[email protected]>
Subject: RE: [PATCH] drm/amdgpu: kfd_pre_reset outside req_full_gpu cause sriov hang

But KFD still need to be notified during reset , the pre_reset call to KFD will let KFD have a chance to suspend all the running process queues. Was the reset works normally on SRIOV before the refactor change for XGMI support ? We shouldn't change the logic .

Regards
shaoyun.liu

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of wentalou
Sent: Friday, December 7, 2018 1:09 AM
To: [email protected]
Cc: Lou, Wentao <[email protected]>
Subject: [PATCH] drm/amdgpu: kfd_pre_reset outside req_full_gpu cause sriov hang

XGMI hive put kfd_pre_reset into amdgpu_device_lock_adev, but outside req_full_gpu of sriov. It would make sriov hang during reset.

Change-Id I5b3e2a42c77b3b9635419df4470d021df7be34d1
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +6 -5
index ef36cc5..659dd40 100644
@@ -3474,14 +3474,16 @@ static void amdgpu_device_lock_adev(struct amdgpu_device *adev)
 	mutex_lock(&adev->lock_reset);
 	atomic_inc(&adev->gpu_reset_counter);
 	adev->in_gpu_reset = 1;
-	/* Block kfd */
-	amdgpu_amdkfd_pre_reset(adev);
+	/* Block kfd: SRIOV would do it separately */
+	if (!amdgpu_sriov_vf(adev))
+                amdgpu_amdkfd_pre_reset(adev);
 }
 
 static void amdgpu_device_unlock_adev(struct amdgpu_device *adev)  {
-	/*unlock kfd */
-	amdgpu_amdkfd_post_reset(adev);
+	/*unlock kfd: SRIOV would do it separately */
+	if (!amdgpu_sriov_vf(adev))
+                amdgpu_amdkfd_post_reset(adev);
 	amdgpu_vf_error_trans_all(adev);
 	adev->in_gpu_reset = 0;
 	mutex_unlock(&adev->lock_reset);
--

2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): BYAPR12MB27424E2E6236D4E73E233E4083A60-ZGDeBxoHBPmbrehcvEBedAdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org

Reviewed-by Shaoyun.liu
#6 lore raw

I see, so ok for me . You can added

-----Original Message-----
From: Lou, Wentao
Sent: Monday, December 10, 2018 11:54 PM
To: Liu, Shaoyun <[email protected]>; [email protected]; Grodzovsky, Andrey <[email protected]>; Kuehling, Felix <[email protected]>
Subject: RE: [PATCH] drm/amdgpu: kfd_pre_reset outside req_full_gpu cause sriov hang

Sriov should not call amdgpu_amdkfd_pre_reset inside amdgpu_device_lock_adev, either amdgpu_amdkfd_post_reset inside amdgpu_device_unlock_adev. In branch amd-staging-dkms-4.18, sriov already called amdgpu_amdkfd_pre_reset and amdgpu_amdkfd_post_reset inside amdgpu_device_reset_sriov. There 2 functions needed to be inside sriov's amdgpu_virt_request_full_gpu, or it would cause sriov hang. amdgpu_amdkfd_pre_reset inside amdgpu_device_lock_adev was duplicated for sriov, and caused cause sriov hang when entering amdgpu_device_lock_adev. That's the reason to add " if (!amdgpu_sriov_vf(adev))" based on branch amd-staging-dkms-4.18.

BR,
Wentao

-----Original Message-----
From: Liu, Shaoyun <[email protected]>
Sent: Tuesday, December 11, 2018 12:10 AM
To: Lou, Wentao <[email protected]>; [email protected]; Grodzovsky, Andrey <[email protected]>; Kuehling, Felix <[email protected]>
Cc: Lou, Wentao <[email protected]>
Subject: RE: [PATCH] drm/amdgpu: kfd_pre_reset outside req_full_gpu cause sriov hang

But KFD still need to be notified during reset , the pre_reset call to KFD will let KFD have a chance to suspend all the running process queues. Was the reset works normally on SRIOV before the refactor change for XGMI support ? We shouldn't change the logic .

Regards
shaoyun.liu

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of wentalou
Sent: Friday, December 7, 2018 1:09 AM
To: [email protected]
Cc: Lou, Wentao <[email protected]>
Subject: [PATCH] drm/amdgpu: kfd_pre_reset outside req_full_gpu cause sriov hang

XGMI hive put kfd_pre_reset into amdgpu_device_lock_adev, but outside req_full_gpu of sriov. It would make sriov hang during reset.

Change-Id I5b3e2a42c77b3b9635419df4470d021df7be34d1
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +6 -5
index ef36cc5..659dd40 100644
@@ -3474,14 +3474,16 @@ static void amdgpu_device_lock_adev(struct amdgpu_device *adev)
 	mutex_lock(&adev->lock_reset);
 	atomic_inc(&adev->gpu_reset_counter);
 	adev->in_gpu_reset = 1;
-	/* Block kfd */
-	amdgpu_amdkfd_pre_reset(adev);
+	/* Block kfd: SRIOV would do it separately */
+	if (!amdgpu_sriov_vf(adev))
+                amdgpu_amdkfd_pre_reset(adev);
 }
 
 static void amdgpu_device_unlock_adev(struct amdgpu_device *adev)  {
-	/*unlock kfd */
-	amdgpu_amdkfd_post_reset(adev);
+	/*unlock kfd: SRIOV would do it separately */
+	if (!amdgpu_sriov_vf(adev))
+                amdgpu_amdkfd_post_reset(adev);
 	amdgpu_vf_error_trans_all(adev);
 	adev->in_gpu_reset = 0;
 	mutex_unlock(&adev->lock_reset);
--

2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx