Skip to content

Commit e48bc01

Browse files
gwendalcrEnric Balletbo i Serra
authored andcommitted
platform/chrome: cros_ec_sensorhub: Fix EC timestamp overflow
EC is using 32 bit timestamps (us), and before converting it to 64bit they were not casted, so it would overflow every 4s. Regular overflow every ~70 minutes was not taken into account either. Signed-off-by: Gwendal Grignou <[email protected]> Signed-off-by: Enric Balletbo i Serra <[email protected]>
1 parent 20b7368 commit e48bc01

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

drivers/platform/chrome/cros_ec_sensorhub_ring.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -419,9 +419,7 @@ cros_ec_sensor_ring_process_event(struct cros_ec_sensorhub *sensorhub,
419419
* Disable filtering since we might add more jitter
420420
* if b is in a random point in time.
421421
*/
422-
new_timestamp = fifo_timestamp -
423-
fifo_info->timestamp * 1000 +
424-
in->timestamp * 1000;
422+
new_timestamp = c - b * 1000 + a * 1000;
425423
/*
426424
* The timestamp can be stale if we had to use the fifo
427425
* info timestamp.

0 commit comments

Comments
 (0)