summaryrefslogtreecommitdiff
path: root/tests/runtime_services
diff options
context:
space:
mode:
authorDimitris Papastamos <dimitris.papastamos@arm.com>2017-06-01 10:18:03 +0100
committerDimitris Papastamos <dimitris.papastamos@arm.com>2017-06-01 10:21:35 +0100
commit11811730520d18d50a1f0d3cc421c26c12db90ef (patch)
tree2ca579498714909c5eb701f478fe508902987549 /tests/runtime_services
parenta616320ae0ecbe283f866736b0a883d27a8f9cfd (diff)
Fix race in PSCI stat test case
`cpu_count` should be reset to 0 after all the cores have reached the common synchronization point. If done earlier, it is possible for a core to be stuck in `wait_for_participating_cpus`. Change-Id: I01b0cf80d468b32edf5c310657a595eb7ce6c947 Signed-off-by: Dimitris Papastamos <dimitris.papastamos@arm.com>
Diffstat (limited to 'tests/runtime_services')
-rw-r--r--tests/runtime_services/standard_service/psci/api_tests/psci_stat/test_psci_stat.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/runtime_services/standard_service/psci/api_tests/psci_stat/test_psci_stat.c b/tests/runtime_services/standard_service/psci/api_tests/psci_stat/test_psci_stat.c
index 5c0294b..e3385c1 100644
--- a/tests/runtime_services/standard_service/psci/api_tests/psci_stat/test_psci_stat.c
+++ b/tests/runtime_services/standard_service/psci/api_tests/psci_stat/test_psci_stat.c
@@ -420,12 +420,6 @@ static test_result_t test_psci_stat(void)
power_state = tftf_make_psci_pstate(pwrlvl, susp_type, state_id);
/*
- * Initialize the cpu_count to zero for synchronizing
- * participating CPUs.
- */
- cpu_count = 0;
-
- /*
* Create a synchronization point. A 2-D event array is used to
* signal every CPU by each CPU. This caters for the fact some
* CPUs may have higher performance than others and will not
@@ -439,6 +433,12 @@ static test_result_t test_psci_stat(void)
tftf_wait_for_event(&stat_sync[cpu_idx][target_idx]);
}
+ /*
+ * Initialize the cpu_count to zero for synchronizing
+ * participating CPUs.
+ */
+ cpu_count = 0;
+
ret = tftf_program_timer_and_suspend(PLAT_SUSPEND_ENTRY_TIME,
power_state, NULL, NULL);
tftf_cancel_timer();