BigW Consortium Gitlab

Commit 06e44802 by Zahid Chowdhury

Fix bug in time_check, task state was not being set before calling sched_timeout

parent b9812146
......@@ -121,8 +121,16 @@ static int time_check(void *data)
long long delta_ns;
ktime_get_real_ts(&before);
while (timeout > 0)
while (timeout > 0) {
/* schedule_timeout requires the task state to be set
* to either TASK_INTERRUPTIBLE or TASK_UNINTERRUPTIBLE,
* otherwise the kernel will not put the task on the sleep list.
* If you have any critical processing you need done in rtc
* then just change this to TASK_UNINTERRUPTIBLE - i.e no signals.
*/
set_current_state(TASK_INTERRUPTIBLE);
timeout = schedule_timeout(timeout);
}
ktime_get_real_ts(&after);
delta_ns = timespec_to_ns(&after) - timespec_to_ns(&before);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment