]> rtime.felk.cvut.cz Git - zynq/linux.git/commit
rt,ntp: Move call to schedule_delayed_work() to helper thread
authorSteven Rostedt <rostedt@goodmis.org>
Wed, 26 Jun 2013 19:28:11 +0000 (15:28 -0400)
committerMichal Sojka <sojka@merica.cz>
Sun, 13 Sep 2015 07:47:46 +0000 (09:47 +0200)
commit37291ff5a80cbdb56e9515bf2eca79b6eb75dcae
treebf56e69c56382ba1bc72c38ca7ca417271ba7e36
parent65aa92684f24cf95b6074161241b1d3829215f2f
rt,ntp: Move call to schedule_delayed_work() to helper thread

The ntp code for notify_cmos_timer() is called from a hard interrupt
context. schedule_delayed_work() under PREEMPT_RT_FULL calls spinlocks
that have been converted to mutexes, thus calling schedule_delayed_work()
from interrupt is not safe.

Add a helper thread that does the call to schedule_delayed_work and wake
up that thread instead of calling schedule_delayed_work() directly.
This is only for CONFIG_PREEMPT_RT_FULL, otherwise the code still calls
schedule_delayed_work() directly in irq context.

Note: There's a few places in the kernel that do this. Perhaps the RT
code should have a dedicated thread that does the checks. Just register
a notifier on boot up for your check and wake up the thread when
needed. This will be a todo.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
kernel/time/ntp.c