otherwise "tt[i].tick" in "handle_tmo" will be a wrong value
in case timer set failed due to
ODP_TIMER_NOEVENT(failed to cancel the outstanding timer).

some hardware timer implementations needs at least two ticks gap between
"current tick" and "future tick" to cancel the outstanding active timer.

Signed-off-by: Jerin Jacob <jerin.ja...@caviumnetworks.com>
---
 test/validation/odp_timer.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/test/validation/odp_timer.c b/test/validation/odp_timer.c
index 554b353..852343a 100644
--- a/test/validation/odp_timer.c
+++ b/test/validation/odp_timer.c
@@ -365,9 +365,9 @@ static void *worker_entrypoint(void *arg TEST_UNUSED)
                        } else if (rc != ODP_TIMER_SUCCESS) {
                                /* Set/reset failed, timer already expired */
                                ntoolate++;
-                       }
-                       /* Save expected expiration tick */
-                       tt[i].tick = cur_tick + tck;
+                       } else if (rc == ODP_TIMER_SUCCESS)
+                               /* Save expected expiration tick on success */
+                               tt[i].tick = cur_tick + tck;
                }
                struct timespec ts;
                ts.tv_sec = 0;
-- 
2.1.0

_______________________________________________
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to