diff options
author | Soby Mathew <soby.mathew@arm.com> | 2017-06-29 18:44:18 +0100 |
---|---|---|
committer | Soby Mathew <soby.mathew@arm.com> | 2017-06-29 18:51:39 +0100 |
commit | 44e21f34a5c12634952ad1673608e694b1fcbe5e (patch) | |
tree | 3337e1b59835e089b7530ae5c6cbf3dacb9b592b /tests/runtime_services | |
parent | 8e987e16b27e0b5ff51ee15fc981b505fc18d90d (diff) |
Cater for early return from CPU SUSPEND when programming timer
Usually the tests program timer, issues suspend and then wait for interrupt
to fire. But sometimes, the CPU_SUSPEND call returns early without trigerring
the interrupt handler and the timer gets reprogrammed by another CPU thus
de-asserting the interrupt. Hence it is imperative that the timer is
cancelled by the test case after every call to program timer to ensure that
this case is handled. Else when the same CPU tries to invoke program_timer
it will fail because the previous timer request is not cancelled.
This patch adds `cancel_timer` call to the system stress test cases to
cover for this corner same.
Change-Id: I9c1b13b16127d407e2e623ce9bbc049bf4f4be53
Signed-off-by: Soby Mathew <soby.mathew@arm.com>
Diffstat (limited to 'tests/runtime_services')
-rw-r--r-- | tests/runtime_services/standard_service/psci/system_tests/test_psci_on_off_suspend_stress.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/runtime_services/standard_service/psci/system_tests/test_psci_on_off_suspend_stress.c b/tests/runtime_services/standard_service/psci/system_tests/test_psci_on_off_suspend_stress.c index 07359a0..12c3892 100644 --- a/tests/runtime_services/standard_service/psci/system_tests/test_psci_on_off_suspend_stress.c +++ b/tests/runtime_services/standard_service/psci/system_tests/test_psci_on_off_suspend_stress.c @@ -167,6 +167,9 @@ static test_result_t random_suspend_off_loop(void) /* Program timer for wake-up event. */ rc = tftf_program_timer_and_suspend(PLAT_SUSPEND_ENTRY_TIME, power_state, NULL, NULL); + + tftf_cancel_timer(); + if (rc != PSCI_E_SUCCESS) { tftf_testcase_printf("CPU timer/suspend returned error" " 0x%x\n", rc); @@ -191,6 +194,9 @@ static test_result_t lead_cpu_main(unsigned long long mpid) /* Program timer for wake-up event. */ rc = tftf_program_timer_and_suspend(PLAT_SUSPEND_ENTRY_TIME, power_state, NULL, NULL); + + tftf_cancel_timer(); + if (rc != PSCI_E_SUCCESS) { tftf_testcase_printf("CPU timer/suspend returned error" " 0x%x\n", rc); @@ -508,6 +514,9 @@ static test_result_t launch_cpu_on_off_stress(void) if (include_cpu_suspend) { ret = tftf_program_timer_and_suspend( PLAT_SUSPEND_ENTRY_TIME, power_state, NULL, NULL); + + tftf_cancel_timer(); + if (ret != PSCI_E_SUCCESS) { tftf_testcase_printf("CPU timer/suspend" " returned error 0x%x\n", ret); |