From c989f0d2d4b2521cbb711fcb84e6f1e49c364b59 Mon Sep 17 00:00:00 2001 From: Felix Beck Date: Mon, 7 Dec 2009 12:52:00 +0100 Subject: [PATCH] --- yaml --- r: 173271 b: refs/heads/master c: 93521314cb3132f40a4bf6d76b4bbcdbc9e59dfb h: refs/heads/master i: 173269: 630cc71df0929445bbd98491fd8cf13ece71684e 173267: 2d3910e6765766fcd5f8a859164ae5446f1dea49 173263: e0ad1c75567ceb68ddae20b5c73bc06014c548ab v: v3 --- [refs] | 2 +- trunk/drivers/s390/crypto/ap_bus.c | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index b59a30a47678..8d96b4dbb7f3 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 7a6f5cd07ee5648f5768637ff082133384af415c +refs/heads/master: 93521314cb3132f40a4bf6d76b4bbcdbc9e59dfb diff --git a/trunk/drivers/s390/crypto/ap_bus.c b/trunk/drivers/s390/crypto/ap_bus.c index 21077f4b8c50..20836eff88c5 100644 --- a/trunk/drivers/s390/crypto/ap_bus.c +++ b/trunk/drivers/s390/crypto/ap_bus.c @@ -102,6 +102,7 @@ static atomic_t ap_poll_requests = ATOMIC_INIT(0); static DECLARE_WAIT_QUEUE_HEAD(ap_poll_wait); static struct task_struct *ap_poll_kthread = NULL; static DEFINE_MUTEX(ap_poll_thread_mutex); +static DEFINE_SPINLOCK(ap_poll_timer_lock); static void *ap_interrupt_indicator; static struct hrtimer ap_poll_timer; /* In LPAR poll with 4kHz frequency. Poll every 250000 nanoseconds. @@ -1170,16 +1171,19 @@ ap_config_timeout(unsigned long ptr) static inline void ap_schedule_poll_timer(void) { ktime_t hr_time; + + spin_lock_bh(&ap_poll_timer_lock); if (ap_using_interrupts() || ap_suspend_flag) - return; + goto out; if (hrtimer_is_queued(&ap_poll_timer)) - return; + goto out; 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; +out: + spin_unlock_bh(&ap_poll_timer_lock); } /** @@ -1668,6 +1672,7 @@ int __init ap_module_init(void) */ if (MACHINE_IS_VM) poll_timeout = 1500000; + spin_lock_init(&ap_poll_timer_lock); hrtimer_init(&ap_poll_timer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS); ap_poll_timer.function = ap_poll_timeout;