arm64: vdso: Fix clock_getres() for CLOCK_REALTIME
[platform/kernel/linux-rpi.git] / arch / arm64 / kernel / vdso.c
index 2d41900..ec0bb58 100644 (file)
@@ -232,6 +232,9 @@ void update_vsyscall(struct timekeeper *tk)
        vdso_data->wtm_clock_sec                = tk->wall_to_monotonic.tv_sec;
        vdso_data->wtm_clock_nsec               = tk->wall_to_monotonic.tv_nsec;
 
+       /* Read without the seqlock held by clock_getres() */
+       WRITE_ONCE(vdso_data->hrtimer_res, hrtimer_resolution);
+
        if (!use_syscall) {
                /* tkr_mono.cycle_last == tkr_raw.cycle_last */
                vdso_data->cs_cycle_last        = tk->tkr_mono.cycle_last;