aboutsummaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorKyösti Mälkki <kyosti.malkki@gmail.com>2019-02-20 17:38:45 +0200
committerPatrick Georgi <pgeorgi@google.com>2019-02-21 19:10:45 +0000
commit187e4c4474a4b678a88b0f7df67e387f0d0d46fb (patch)
tree905e54214771008f7591a04c83974a7b2024f41a /src/lib
parent69a95653399657bf6b2491c259479c954fee2509 (diff)
timestamp: Move timestamp_should_run() call
Old location caused spurious error messages when called from APs, where timestamp_add_now() should do nothing. Moving the test also makes get_us_from_boot() usable from APs (assuming cache coherency). Change-Id: Ice9ece11b15bbe1a58a038cda3d299862e6f822b Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: https://review.coreboot.org/c/31524 Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-by: Furquan Shaikh <furquan@google.com> Reviewed-by: Werner Zeh <werner.zeh@siemens.com> Reviewed-by: Julius Werner <jwerner@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/timestamp.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/timestamp.c b/src/lib/timestamp.c
index 6885e7b55b..f84b9d5bc7 100644
--- a/src/lib/timestamp.c
+++ b/src/lib/timestamp.c
@@ -125,9 +125,6 @@ static struct timestamp_table *timestamp_table_get(void)
MAYBE_STATIC struct timestamp_table *ts_table = NULL;
struct timestamp_cache *ts_cache;
- if (!timestamp_should_run())
- return NULL;
-
if (ts_table != NULL)
return ts_table;
@@ -188,6 +185,9 @@ void timestamp_add(enum timestamp_id id, uint64_t ts_time)
{
struct timestamp_table *ts_table;
+ if (!timestamp_should_run())
+ return;
+
ts_table = timestamp_table_get();
if (!ts_table) {