diff options
author | Gwendal Grignou <gwendal@chromium.org> | 2020-06-30 09:52:03 +0200 |
---|---|---|
committer | Enric Balletbo i Serra <enric.balletbo@collabora.com> | 2020-06-30 16:35:22 +0200 |
commit | e48bc01ed5adec203676c735365373b31c3c7600 (patch) | |
tree | 61f47499950cd552a514ea7a4ed53c863f241780 /drivers/platform/chrome | |
parent | platform/chrome: cros_ec_typec: Add PM support (diff) | |
download | linux-e48bc01ed5adec203676c735365373b31c3c7600.tar.xz linux-e48bc01ed5adec203676c735365373b31c3c7600.zip |
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 <gwendal@chromium.org>
Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Diffstat (limited to 'drivers/platform/chrome')
-rw-r--r-- | drivers/platform/chrome/cros_ec_sensorhub_ring.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/platform/chrome/cros_ec_sensorhub_ring.c b/drivers/platform/chrome/cros_ec_sensorhub_ring.c index 24e48d96ed76..b1c641c72f51 100644 --- a/drivers/platform/chrome/cros_ec_sensorhub_ring.c +++ b/drivers/platform/chrome/cros_ec_sensorhub_ring.c @@ -419,9 +419,7 @@ cros_ec_sensor_ring_process_event(struct cros_ec_sensorhub *sensorhub, * Disable filtering since we might add more jitter * if b is in a random point in time. */ - new_timestamp = fifo_timestamp - - fifo_info->timestamp * 1000 + - in->timestamp * 1000; + new_timestamp = c - b * 1000 + a * 1000; /* * The timestamp can be stale if we had to use the fifo * info timestamp. |