summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonio Nino Diaz <antonio.ninodiaz@arm.com>2018-02-09 14:17:21 +0000
committerSandrine Bailleux <sandrine.bailleux@arm.com>2018-02-09 14:54:03 +0000
commit5f9423b80b9eea52610dd9d151c6072c2bead569 (patch)
tree78cba411bc7a0fafa8185c00676819ca6589edbf
parent95c34bca6734d05e9d92b8774d041a9d1ccb7893 (diff)
Don't fail preemtion tests if SGI aren't handled
A pending interrupt doesn't have to be handled right after enabling interrupts, but the tests wrongly assume that they have to. This patch changes the behaviour of the tests so that the error message is just a VERBOSE print, in case it is helpful for debugging other problems with the tests. Change-Id: I26ad42f871eb8b0d5f870950dd2e226f2e3c680d Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
-rw-r--r--tests/runtime_services/trusted_os/tsp/test_irq_preempted_std_smc.c51
1 files changed, 29 insertions, 22 deletions
diff --git a/tests/runtime_services/trusted_os/tsp/test_irq_preempted_std_smc.c b/tests/runtime_services/trusted_os/tsp/test_irq_preempted_std_smc.c
index 0ea6fc4..861320a 100644
--- a/tests/runtime_services/trusted_os/tsp/test_irq_preempted_std_smc.c
+++ b/tests/runtime_services/trusted_os/tsp/test_irq_preempted_std_smc.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, ARM Limited and Contributors. All rights reserved.
+ * Copyright (c) 2017-2018, ARM Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -135,18 +135,21 @@ static int preempt_std_smc_on_this_cpu(void)
result = TEST_RESULT_FAIL;
}
- /* Set PSTATE.I to 1. */
+ /* Set PSTATE.I to 1. Let the SGI be handled. */
enable_irq();
- /* Let the SGI be handled and check that it has been handled. */
- if (requested_irq_received[core_pos] == 0) {
- tftf_testcase_printf("SGI not handled @ CPU %d\n", core_pos);
- result = TEST_RESULT_FAIL;
- }
-
/* Cleanup. Disable and unregister SGI handler. */
unregister_and_disable_test_sgi_handler();
+ /*
+ * Check that the SGI has been handled, but don't fail if it hasn't
+ * because there is no guarantee that it will have actually happened at
+ * this point.
+ */
+ if (requested_irq_received[core_pos] == 0) {
+ VERBOSE("SGI not handled @ CPU %d\n", core_pos);
+ }
+
return result;
}
@@ -500,22 +503,21 @@ static test_result_t test_resume_different_cpu_preempted_std_smc_non_lead_fn(voi
return TEST_RESULT_FAIL;
}
- /* Set PSTATE.I to 1. */
+ /* Set PSTATE.I to 1. Let the SGI be handled. */
enable_irq();
- /* Let the SGI be handled and check that it has been handled. */
- if (requested_irq_received[core_pos] == 0) {
- tftf_testcase_printf("SGI wasn't handled @ CPU %d\n",
- core_pos);
- unregister_and_disable_test_sgi_handler();
- /* Signal to the lead CPU that the calling CPU has finished */
- tftf_send_event(&cpu_has_finished_test[core_pos]);
- return TEST_RESULT_FAIL;
- }
-
/* Cleanup. Disable and unregister SGI handler. */
unregister_and_disable_test_sgi_handler();
+ /*
+ * Check that the SGI has been handled, but don't fail if it hasn't
+ * because there is no guarantee that it will have actually happened at
+ * this point.
+ */
+ if (requested_irq_received[core_pos] == 0) {
+ VERBOSE("SGI not handled @ CPU %d\n", core_pos);
+ }
+
/* Resume the STD SMC. Verify result. */
std_smc_args.arg0 = TSP_FID_RESUME;
smc_ret = tftf_smc(&std_smc_args);
@@ -608,14 +610,19 @@ test_result_t test_resume_different_cpu_preempted_std_smc(void)
return TEST_RESULT_FAIL;
}
- /* Let the SGI be handled and check that it has been handled. */
+ /* Set PSTATE.I to 1. Let the SGI be handled. */
enable_irq();
+ /* Cleanup. Disable and unregister SGI handler. */
unregister_and_disable_test_sgi_handler();
+ /*
+ * Check that the SGI has been handled, but don't fail if it hasn't
+ * because there is no guarantee that it will have actually happened at
+ * this point.
+ */
if (requested_irq_received[lead_pos] == 0) {
- tftf_testcase_printf("SGI wasn't handled @ lead CPU.\n");
- return TEST_RESULT_FAIL;
+ VERBOSE("SGI not handled @ lead CPU.\n");
}
/* Generate a preempted SMC in a secondary CPU. */