summaryrefslogtreecommitdiff
path: root/drivers/s390
diff options
context:
space:
mode:
authorFelix Beck <felix.beck@de.ibm.com>2009-07-24 14:39:53 +0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2009-07-24 14:41:02 +0400
commit8d406c6de2e67b5bae3c43b62b492c4ff63afb92 (patch)
treec7c6d70fe22561dcfa16ec9778829c023e5c7ade /drivers/s390
parent1277580fe5dfb5aef84854bdb7983657df00b920 (diff)
downloadlinux-8d406c6de2e67b5bae3c43b62b492c4ff63afb92.tar.xz
[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: Felix Beck <felix.beck@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390')
-rw-r--r--drivers/s390/crypto/ap_bus.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/s390/crypto/ap_bus.c b/drivers/s390/crypto/ap_bus.c
index 727a809636d8..ed3dcdea7fe1 100644
--- a/drivers/s390/crypto/ap_bus.c
+++ b/drivers/s390/crypto/ap_bus.c
@@ -1145,12 +1145,17 @@ ap_config_timeout(unsigned long ptr)
*/
static inline void ap_schedule_poll_timer(void)
{
+ ktime_t hr_time;
if (ap_using_interrupts() || ap_suspend_flag)
return;
if (hrtimer_is_queued(&ap_poll_timer))
return;
- hrtimer_start(&ap_poll_timer, ktime_set(0, poll_timeout),
- HRTIMER_MODE_ABS);
+ if (ktime_to_ns(hrtimer_expires_remaining(&ap_poll_timer)) <= 0) {
+ hr_time = ktime_set(0, poll_timeout);
+ hrtimer_forward_now(&ap_poll_timer, hr_time);
+ hrtimer_restart(&ap_poll_timer);
+ }
+ return;
}
/**