OSDN Git Service

amdgpu: add ras feature capability check in inject test
authorGuchun Chen <guchun.chen@amd.com>
Wed, 28 Aug 2019 10:25:43 +0000 (18:25 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 16 Sep 2019 12:57:10 +0000 (07:57 -0500)
When running ras inject test, it's needed to be aligned
with kernel's ras enablement.

Acked-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Guchun Chen <guchun.chen@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
tests/amdgpu/ras_tests.c

index d510b64..c1c543c 100644 (file)
@@ -861,6 +861,10 @@ static void __amdgpu_ras_ip_inject_test(const struct ras_inject_test_config *ip_
                if (block == ARRAY_SIZE(ras_block_string))
                        break;
 
+               /* Ensure RAS feature for the IP block is enabled by kernel */
+               if (amdgpu_ras_is_feature_supported(block) <= 0)
+                       break;
+
                ret = amdgpu_ras_query_err_count(block, &old_ue, &old_ce);
                CU_ASSERT_EQUAL(ret, 0);
                if (ret)