Skip to contentSkip to conversation

drm/amdgpu: make IB test synchronize with init for SRIOV(v2)

PATCH In review Monk Liu 2 participants 3 messages Jun 29, 2020

Subsystems (2)
lore
Share & tools
lore

Monk Liu

author
#0 lore raw

PATCH 1/1 drm/amdgpu: make IB test synchronize with init for SRIOV(v2)

issue:
originally we kickoff IB test asynchronously with driver's init, thus
the IB test may still running when the driver loading done (modprobe amdgpu done).
if we shutdown VM immediately after amdgpu driver loaded then GPU may
hang because the IB test is still running

fix:
flush the delayed_init routine at the bottom of device_init to avoid driver loading done prior to the IB test completes

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +3 -0
index 457f5d2..7a4e965 100644
@@ -3295,6 +3295,9 @@ int amdgpu_device_init(struct amdgpu_device *adev,
 	queue_delayed_work(system_wq, &adev->delayed_init_work,
 			   msecs_to_jiffies(AMDGPU_RESUME_MS));
 
+	if (amdgpu_sriov_vf(adev))
+		flush_delayed_work(&adev->delayed_init_work);
+
 	r = sysfs_create_files(&adev->dev->kobj, amdgpu_dev_attributes);
 	if (r) {
 		dev_err(adev->dev, "Could not create amdgpu device attr\n");
Signature · 6 lines
2.7.4

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

Am 29.06.20 um 11:35 schrieb Monk Liu:

Quoted 9 lines

issue:
originally we kickoff IB test asynchronously with driver's init, thus
the IB test may still running when the driver loading done (modprobe amdgpu done).
if we shutdown VM immediately after amdgpu driver loaded then GPU may
hang because the IB test is still running

Quoted 5 lines

fix:
flush the delayed_init routine at the bottom of device_init to avoid driver loading done prior to the IB test completes

Maybe do this even after sysfs and PMU init, but either way Acked-by: Christian König <[email protected]>

Quoted 9 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 3 +++
  1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0 -0
index 457f5d2..7a4e965 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c int amdgpu_device_init(struct amdgpu_device *adev, · line 3303

Quoted 9 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +3 -0
@@ -3295,6 +3295,9 @@ int amdgpu_device_init(struct amdgpu_device *adev,
  	queue_delayed_work(system_wq, &adev->delayed_init_work,
  			   msecs_to_jiffies(AMDGPU_RESUME_MS));
 
+	if (amdgpu_sriov_vf(adev))
+		flush_delayed_work(&adev->delayed_init_work);
+
  	r = sysfs_create_files(&adev->dev->kobj, amdgpu_dev_attributes);
  	if (r) {
  		dev_err(adev->dev, "Could not create amdgpu device attr\n");

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

author
#2 lore raw

We'd better not let the flush after sysfs creation otherwise there is chance that user use sysfs to touch hardware before the IB test done and introduce headache issues

_____________________________________
Monk Liu|GPU Virtualization Team |AMD

-----Original Message-----
From: Christian König <[email protected]>
Sent: Monday, June 29, 2020 5:44 PM
To: Liu, Monk <[email protected]>; [email protected]
Subject: Re: [PATCH] drm/amdgpu: make IB test synchronize with init for SRIOV(v2)

Am 29.06.20 um 11:35 schrieb Monk Liu:

Quoted 7 lines

issue:
originally we kickoff IB test asynchronously with driver's init, thus the IB test may still running when the driver loading done (modprobe amdgpu done).
if we shutdown VM immediately after amdgpu driver loaded then GPU may hang because the IB test is still running

Quoted 5 lines

fix:
flush the delayed_init routine at the bottom of device_init to avoid driver loading done prior to the IB test completes

Maybe do this even after sysfs and PMU init, but either way Acked-by:
Christian König <[email protected]>

Quoted 10 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 3 +++
  1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0 -0
index 457f5d2..7a4e965 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c int amdgpu_device_init(struct amdgpu_device *adev, · line 3303

Quoted 9 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +3 -0
@@ -3295,6 +3295,9 @@ int amdgpu_device_init(struct amdgpu_device *adev,
  	queue_delayed_work(system_wq, &adev->delayed_init_work,
  			   msecs_to_jiffies(AMDGPU_RESUME_MS));
 
+	if (amdgpu_sriov_vf(adev))
+		flush_delayed_work(&adev->delayed_init_work);
+
  	r = sysfs_create_files(&adev->dev->kobj, amdgpu_dev_attributes);
  	if (r) {
  		dev_err(adev->dev, "Could not create amdgpu device attr\n");

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