drm: Branch 'master' - 2 commits

[email protected] (Andrey Grodzovsky) Fri, 26 Jan 2018 12:52:18 +0000 (UTC)
Newsgroups gmane.comp.video.dri.patches
Message-ID <[email protected]>
 tests/amdgpu/deadlock_tests.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 429bb5820d2bb1e99dba15c05e912226be1ad1fc
Author: Andrey Grodzovsky <[email protected]>
Date:   Thu Jan 25 13:03:32 2018 -0500

    amdgpu: Fix segfault in deadlock test.
    
    If amdgpu_cs_query_fence_status terminates prematurely the BO
    sometimes is unmapped before helper thread writes a vlaue
    into it causing a segfault.
    
    Signed-off-by: Andrey Grodzovsky <[email protected]>

diff --git a/tests/amdgpu/deadlock_tests.c b/tests/amdgpu/deadlock_tests.c
index 9a428858..fc49c48a 100644
--- a/tests/amdgpu/deadlock_tests.c
+++ b/tests/amdgpu/deadlock_tests.c
@@ -245,6 +245,8 @@ static void amdgpu_deadlock_helper(unsigned ip_type)
 			AMDGPU_TIMEOUT_INFINITE,0, &expired);
 	CU_ASSERT_EQUAL((r == 0 || r == -ECANCELED), 1);
 
+	pthread_join(stress_thread, NULL);
+
 	r = amdgpu_bo_list_destroy(bo_list);
 	CU_ASSERT_EQUAL(r, 0);
 
@@ -254,6 +256,4 @@ static void amdgpu_deadlock_helper(unsigned ip_type)
 
 	r = amdgpu_cs_ctx_free(context_handle);
 	CU_ASSERT_EQUAL(r, 0);
-
-	pthread_join(stress_thread, NULL);
 }
commit 5e239f3e3d18e13e6ffa3128407d37b3c7582593
Author: Andrey Grodzovsky <[email protected]>
Date:   Thu Jan 25 13:00:54 2018 -0500

    amdgpu: Update deadlock test to not assert on ECANCELED
    
    Kernel will abort jobs for guilty (causing GPU hang) context
    with -ECANCELED don't assert if that the case.
    
    Signed-off-by: Andrey Grodzovsky <[email protected]>
    Acked-by: Christian König <[email protected]>

diff --git a/tests/amdgpu/deadlock_tests.c b/tests/amdgpu/deadlock_tests.c
index cd34cdf6..9a428858 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);

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
--
_______________________________________________
Dri-patches mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dri-patches