diff options
| author | Linux Build Service Account <lnxbuild@localhost> | 2017-02-08 17:48:22 -0800 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2017-02-08 17:48:22 -0800 |
| commit | 4615d1ffcd48ccbeecc279d90546e25a99076979 (patch) | |
| tree | db05c976d066459e6da0d9b8f0ef28fb95a2567f | |
| parent | 536d517bb156440f8a048711659be18eca0ec288 (diff) | |
| parent | 5dbeb97af8194acb39f0c5c4be9184575845fd98 (diff) | |
Merge "arm64: gettimeofday change for timer rollover condition"
| -rw-r--r-- | arch/arm64/kernel/vdso/gettimeofday.S | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/arch/arm64/kernel/vdso/gettimeofday.S b/arch/arm64/kernel/vdso/gettimeofday.S index efa79e8d4196..9f8eeccae67c 100644 --- a/arch/arm64/kernel/vdso/gettimeofday.S +++ b/arch/arm64/kernel/vdso/gettimeofday.S @@ -216,16 +216,25 @@ ENDPROC(__kernel_clock_getres) ENTRY(__do_get_tspec) .cfi_startproc + /* Read the virtual counter. */ + isb +#if IS_ENABLED(CONFIG_MSM_TIMER_LEAP) +#define LEAST_32BITS 0x00000000FFFFFFFF +reread: + mrs x15, cntvct_el0 + and x13, x15, #LEAST_32BITS + eor x13, x13, #LEAST_32BITS + cbz x13, reread +#else + mrs x15, cntvct_el0 +#endif + /* Read from the vDSO data page. */ ldr x10, [vdso_data, #VDSO_CS_CYCLE_LAST] ldp x13, x14, [vdso_data, #VDSO_XTIME_CLK_SEC] ldp w11, w12, [vdso_data, #VDSO_CS_MULT] seqcnt_read w9 - /* Read the virtual counter. */ - isb - mrs x15, cntvct_el0 - /* Calculate cycle delta and convert to ns. */ sub x10, x15, x10 /* We can only guarantee 56 bits of precision. */ |
