drm/amdgpu: For sriov reset, move IB test into exclusive mode

Submitted by Deng, Emily on April 26, 2018, 4:06 a.m.

Details

Message ID 1524715601-2955-1-git-send-email-Emily.Deng@amd.com
State New
Headers show
Series "drm/amdgpu: For sriov reset, move IB test into exclusive mode" ( rev: 2 ) in AMD X.Org drivers

Not browsing as part of any series.

Commit Message

Deng, Emily April 26, 2018, 4:06 a.m.
When put the IB test out of exclusive mode, and do sriov reset,
the IB test will randomly fail. As out of exclusive mode it uses
kiq to do read and write registers, but as it has world switch,
the kiq read and write time will be random, sometimes it will
beyond the MAX_KIQ_REG_WAIT and then the read or write register
will fail, which will result the IB test fail.

Signed-off-by: Emily Deng <Emily.Deng@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Patch hide | download patch | download mbox

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index f509d32..692d172 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -3140,20 +3140,19 @@  static int amdgpu_device_reset_sriov(struct amdgpu_device *adev,
 
 	/* now we are okay to resume SMC/CP/SDMA */
 	r = amdgpu_device_ip_reinit_late_sriov(adev);
-	amdgpu_virt_release_full_gpu(adev, true);
 	if (r)
 		goto error;
 
 	amdgpu_irq_gpu_reset_resume_helper(adev);
 	r = amdgpu_ib_ring_tests(adev);
 
+error:
+	amdgpu_virt_release_full_gpu(adev, true);
 	if (!r && adev->virt.gim_feature & AMDGIM_FEATURE_GIM_FLR_VRAMLOST) {
 		atomic_inc(&adev->vram_lost_counter);
 		r = amdgpu_device_handle_vram_lost(adev);
 	}
 
-error:
-
 	return r;
 }
 

Comments

Hi all,
    Please help review this.

Best Wishes,
Emily Deng




> -----Original Message-----

> From: amd-gfx [mailto:amd-gfx-bounces@lists.freedesktop.org] On Behalf Of

> Emily Deng

> Sent: Thursday, April 26, 2018 12:07 PM

> To: amd-gfx@lists.freedesktop.org

> Cc: Deng, Emily <Emily.Deng@amd.com>

> Subject: [PATCH] drm/amdgpu: For sriov reset, move IB test into exclusive

> mode

> 

> When put the IB test out of exclusive mode, and do sriov reset, the IB test

> will randomly fail. As out of exclusive mode it uses kiq to do read and write

> registers, but as it has world switch, the kiq read and write time will be

> random, sometimes it will beyond the MAX_KIQ_REG_WAIT and then the

> read or write register will fail, which will result the IB test fail.

> 

> Signed-off-by: Emily Deng <Emily.Deng@amd.com>

> ---

>  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 5 ++---

>  1 file changed, 2 insertions(+), 3 deletions(-)

> 

> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c

> b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c

> index f509d32..692d172 100644

> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c

> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c

> @@ -3140,20 +3140,19 @@ static int amdgpu_device_reset_sriov(struct

> amdgpu_device *adev,

> 

>  	/* now we are okay to resume SMC/CP/SDMA */

>  	r = amdgpu_device_ip_reinit_late_sriov(adev);

> -	amdgpu_virt_release_full_gpu(adev, true);

>  	if (r)

>  		goto error;

> 

>  	amdgpu_irq_gpu_reset_resume_helper(adev);

>  	r = amdgpu_ib_ring_tests(adev);

> 

> +error:

> +	amdgpu_virt_release_full_gpu(adev, true);

>  	if (!r && adev->virt.gim_feature &

> AMDGIM_FEATURE_GIM_FLR_VRAMLOST) {

>  		atomic_inc(&adev->vram_lost_counter);

>  		r = amdgpu_device_handle_vram_lost(adev);

>  	}

> 

> -error:

> -

>  	return r;

>  }

> 

> --

> 2.7.4

> 

> _______________________________________________

> amd-gfx mailing list

> amd-gfx@lists.freedesktop.org

> https://lists.freedesktop.org/mailman/listinfo/amd-gfx