]> rtime.felk.cvut.cz Git - zynq/linux.git/blobdiff - kernel/time/ntp.c
Apply preempt_rt patch-4.9-rt1.patch.xz
[zynq/linux.git] / kernel / time / ntp.c
index 6df8927c58a5bbedcab9efceac7c21985bec0bf0..05b7391bf9bd5aaa991248338b61ee094a00ed6e 100644 (file)
@@ -17,6 +17,7 @@
 #include <linux/module.h>
 #include <linux/rtc.h>
 #include <linux/math64.h>
+#include <linux/swork.h>
 
 #include "ntp_internal.h"
 #include "timekeeping_internal.h"
@@ -568,10 +569,35 @@ static void sync_cmos_clock(struct work_struct *work)
                           &sync_cmos_work, timespec64_to_jiffies(&next));
 }
 
+#ifdef CONFIG_PREEMPT_RT_FULL
+
+static void run_clock_set_delay(struct swork_event *event)
+{
+       queue_delayed_work(system_power_efficient_wq, &sync_cmos_work, 0);
+}
+
+static struct swork_event ntp_cmos_swork;
+
+void ntp_notify_cmos_timer(void)
+{
+       swork_queue(&ntp_cmos_swork);
+}
+
+static __init int create_cmos_delay_thread(void)
+{
+       WARN_ON(swork_get());
+       INIT_SWORK(&ntp_cmos_swork, run_clock_set_delay);
+       return 0;
+}
+early_initcall(create_cmos_delay_thread);
+
+#else
+
 void ntp_notify_cmos_timer(void)
 {
        queue_delayed_work(system_power_efficient_wq, &sync_cmos_work, 0);
 }
+#endif /* CONFIG_PREEMPT_RT_FULL */
 
 #else
 void ntp_notify_cmos_timer(void) { }