]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/blobdiff - kernel/time/ntp.c
ntp: Use freezable workqueue for RTC synchronization
[mirror_ubuntu-hirsute-kernel.git] / kernel / time / ntp.c
index 7404d38315276a96fa69f78d67a856c4867dbf95..5247afd7f34552b0c4fe0f1421302ad7c1cbc5c1 100644 (file)
@@ -498,11 +498,11 @@ out:
 static void sync_hw_clock(struct work_struct *work);
 static DECLARE_WORK(sync_work, sync_hw_clock);
 static struct hrtimer sync_hrtimer;
-#define SYNC_PERIOD_NS (11UL * 60 * NSEC_PER_SEC)
+#define SYNC_PERIOD_NS (11ULL * 60 * NSEC_PER_SEC)
 
 static enum hrtimer_restart sync_timer_callback(struct hrtimer *timer)
 {
-       queue_work(system_power_efficient_wq, &sync_work);
+       queue_work(system_freezable_power_efficient_wq, &sync_work);
 
        return HRTIMER_NORESTART;
 }
@@ -512,7 +512,7 @@ static void sched_sync_hw_clock(unsigned long offset_nsec, bool retry)
        ktime_t exp = ktime_set(ktime_get_real_seconds(), 0);
 
        if (retry)
-               exp = ktime_add_ns(exp, 2 * NSEC_PER_SEC - offset_nsec);
+               exp = ktime_add_ns(exp, 2ULL * NSEC_PER_SEC - offset_nsec);
        else
                exp = ktime_add_ns(exp, SYNC_PERIOD_NS - offset_nsec);
 
@@ -668,7 +668,7 @@ void ntp_notify_cmos_timer(void)
         * just a pointless work scheduled.
         */
        if (ntp_synced() && !hrtimer_is_queued(&sync_hrtimer))
-               queue_work(system_power_efficient_wq, &sync_work);
+               queue_work(system_freezable_power_efficient_wq, &sync_work);
 }
 
 static void __init ntp_init_cmos_sync(void)