summaryrefslogtreecommitdiff
path: root/kernel/time/ntp.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/time/ntp.c')
-rw-r--r--kernel/time/ntp.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/kernel/time/ntp.c b/kernel/time/ntp.c
index 406dccb79c2b..85a56b888671 100644
--- a/kernel/time/ntp.c
+++ b/kernel/time/ntp.c
@@ -494,6 +494,7 @@ out:
return leap;
}
+unsigned int sysctl_ntp_rtc_sync = true;
#if defined(CONFIG_GENERIC_CMOS_UPDATE) || defined(CONFIG_RTC_SYSTOHC)
static void sync_hw_clock(struct work_struct *work);
static DECLARE_WORK(sync_work, sync_hw_clock);
@@ -635,7 +636,8 @@ static void sync_hw_clock(struct work_struct *work)
* managed to schedule the work between the timer firing and the
* work being able to rearm the timer. Wait for the timer to expire.
*/
- if (!ntp_synced() || hrtimer_is_queued(&sync_hrtimer))
+ if (!ntp_synced() || !sysctl_ntp_rtc_sync ||
+ hrtimer_is_queued(&sync_hrtimer))
return;
ktime_get_real_ts64(&now);
@@ -667,7 +669,8 @@ void ntp_notify_cmos_timer(void)
* rearmed this queues the work immediately again. No big issue,
* just a pointless work scheduled.
*/
- if (ntp_synced() && !hrtimer_is_queued(&sync_hrtimer))
+ if (ntp_synced() && sysctl_ntp_rtc_sync &&
+ !hrtimer_is_queued(&sync_hrtimer))
queue_work(system_freezable_power_efficient_wq, &sync_work);
}