OSDN Git Service

amdgpu: add ras feature capability check in inject test
[android-x86/external-libdrm.git] / 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)