[PATCH] drm/amd/amdgpu: fini data exchange when req_gpu_fini in SRIOV

Zhang, Jack (Jian) Jack.Zhang1 at amd.com
Fri Mar 5 05:38:09 UTC 2021


[AMD Official Use Only - Internal Distribution Only]

Please comments what the issue is without this change.

/Jack
-----Original Message-----
From: Jingwen Chen <Jingwen.Chen2 at amd.com>
Sent: Friday, March 5, 2021 12:44 PM
To: amd-gfx at lists.freedesktop.org
Cc: Chen, Horace <Horace.Chen at amd.com>; Zhang, Jack (Jian) <Jack.Zhang1 at amd.com>; Chen, JingWen <JingWen.Chen2 at amd.com>
Subject: [PATCH] drm/amd/amdgpu: fini data exchange when req_gpu_fini in SRIOV

Do fini data exchange everytime req_gpu_fini in SRIOV

Signed-off-by: Jingwen Chen <Jingwen.Chen2 at amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 +---
 drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c   | 3 +++
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index a11760ec3924..e3ed52f66414 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -3601,10 +3601,8 @@ void amdgpu_device_fini(struct amdgpu_device *adev)
 /* make sure IB test finished before entering exclusive mode
  * to avoid preemption on IB test
  * */
-if (amdgpu_sriov_vf(adev)) {
+if (amdgpu_sriov_vf(adev))
 amdgpu_virt_request_full_gpu(adev, false);
-amdgpu_virt_fini_data_exchange(adev);
-}

 /* disable all interrupts */
 amdgpu_irq_disable_all(adev);
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
index 3dd7eec52344..af1e5d8fc2b8 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
@@ -114,6 +114,9 @@ int amdgpu_virt_request_full_gpu(struct amdgpu_device *adev, bool init)
 struct amdgpu_virt *virt = &adev->virt;
 int r;

+if (!init)
+amdgpu_virt_fini_data_exchange(adev);
+
 if (virt->ops && virt->ops->req_full_gpu) {
 r = virt->ops->req_full_gpu(adev, init);
 if (r)
--
2.25.1



More information about the amd-gfx mailing list