提交 8d406c6d 编写于 作者: F Felix Beck 提交者: Martin Schwidefsky

[S390] zcrypt: fix scheduling of hrtimer ap_poll_timer

Every time a request is enqueued or there is some work outstanding
from the ap_tasklet, the ap_poll_timer is scheduled again.
Unfortunately it was permanently called. It looked as if it was
started in the past and thus imediately expired.
This has been changed. First it is checked if the hrtimer is already
expired. Then the expiring time is forwarded and the timer restarted.
Signed-off-by: NFelix Beck <felix.beck@de.ibm.com>
Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
上级 1277580f
...@@ -1145,12 +1145,17 @@ ap_config_timeout(unsigned long ptr) ...@@ -1145,12 +1145,17 @@ ap_config_timeout(unsigned long ptr)
*/ */
static inline void ap_schedule_poll_timer(void) static inline void ap_schedule_poll_timer(void)
{ {
ktime_t hr_time;
if (ap_using_interrupts() || ap_suspend_flag) if (ap_using_interrupts() || ap_suspend_flag)
return; return;
if (hrtimer_is_queued(&ap_poll_timer)) if (hrtimer_is_queued(&ap_poll_timer))
return; return;
hrtimer_start(&ap_poll_timer, ktime_set(0, poll_timeout), if (ktime_to_ns(hrtimer_expires_remaining(&ap_poll_timer)) <= 0) {
HRTIMER_MODE_ABS); hr_time = ktime_set(0, poll_timeout);
hrtimer_forward_now(&ap_poll_timer, hr_time);
hrtimer_restart(&ap_poll_timer);
}
return;
} }
/** /**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册