diff mbox

[libdrm,1/2] amdgpu: Update deadlock test to not assert on -ECANCELED

Message ID 1516903859-3679-1-git-send-email-andrey.grodzovsky@amd.com (mailing list archive)
State New, archived
Headers show

Commit Message

Andrey Grodzovsky Jan. 25, 2018, 6:10 p.m. UTC
Kernel will abort jobs for guilty (causing GPU hang) context
with -ECANCELED don't assert if that the case.

Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
---
 tests/amdgpu/deadlock_tests.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Christian König Jan. 25, 2018, 6:26 p.m. UTC | #1
Am 25.01.2018 um 19:10 schrieb Andrey Grodzovsky:
> Kernel will abort jobs for guilty (causing GPU hang) context
> with -ECANCELED don't assert if that the case.
>
> Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>

Acked-by: Christian König <christian.koenig@amd.com>

> ---
>   tests/amdgpu/deadlock_tests.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/tests/amdgpu/deadlock_tests.c b/tests/amdgpu/deadlock_tests.c
> index cd34cdf..9a42885 100644
> --- a/tests/amdgpu/deadlock_tests.c
> +++ b/tests/amdgpu/deadlock_tests.c
> @@ -230,7 +230,7 @@ static void amdgpu_deadlock_helper(unsigned ip_type)
>   
>   	for (i = 0; i < 200; i++) {
>   		r = amdgpu_cs_submit(context_handle, 0,&ibs_request, 1);
> -		CU_ASSERT_EQUAL(r, 0);
> +		CU_ASSERT_EQUAL((r == 0 || r == -ECANCELED), 1);
>   
>   	}
>   
> @@ -243,7 +243,7 @@ static void amdgpu_deadlock_helper(unsigned ip_type)
>   
>   	r = amdgpu_cs_query_fence_status(&fence_status,
>   			AMDGPU_TIMEOUT_INFINITE,0, &expired);
> -	CU_ASSERT_EQUAL(r, 0);
> +	CU_ASSERT_EQUAL((r == 0 || r == -ECANCELED), 1);
>   
>   	r = amdgpu_bo_list_destroy(bo_list);
>   	CU_ASSERT_EQUAL(r, 0);
diff mbox

Patch

diff --git a/tests/amdgpu/deadlock_tests.c b/tests/amdgpu/deadlock_tests.c
index cd34cdf..9a42885 100644
--- a/tests/amdgpu/deadlock_tests.c
+++ b/tests/amdgpu/deadlock_tests.c
@@ -230,7 +230,7 @@  static void amdgpu_deadlock_helper(unsigned ip_type)
 
 	for (i = 0; i < 200; i++) {
 		r = amdgpu_cs_submit(context_handle, 0,&ibs_request, 1);
-		CU_ASSERT_EQUAL(r, 0);
+		CU_ASSERT_EQUAL((r == 0 || r == -ECANCELED), 1);
 
 	}
 
@@ -243,7 +243,7 @@  static void amdgpu_deadlock_helper(unsigned ip_type)
 
 	r = amdgpu_cs_query_fence_status(&fence_status,
 			AMDGPU_TIMEOUT_INFINITE,0, &expired);
-	CU_ASSERT_EQUAL(r, 0);
+	CU_ASSERT_EQUAL((r == 0 || r == -ECANCELED), 1);
 
 	r = amdgpu_bo_list_destroy(bo_list);
 	CU_ASSERT_EQUAL(r, 0);