Skip to content
Commit dcda15d1 authored by Enjia Mai's avatar Enjia Mai Committed by Stephanos Ioannidis
Browse files

drivers: timer: use sys_read64 to read HPET counter on 64 bits cpu



For 32 bit processor to read the 64 bits hpet counter, the HPET spec
2.4.7 suggest to read HPET counter high and low then checking the
high bits to decide if it rollovers or not.

But this logic seems to cause problem for 64 bits processor under SMP,
there is a possible one tick earier under tickless mode. It is likely
to be the cache coherence issue, because a mfence instruction before
reading the timer works.

So we change to read the 64 bits counter by sys_read64 on 64bit
processor to prevent this issue.

Fixes #49611

Signed-off-by: default avatarEnjia Mai <enjia.mai@intel.com>
parent d37bd2eb
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment