aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc/sgi-xp
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2014-01-02 07:07:52 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-01-08 18:18:02 -0500
commit11d5ceb646d11caecb57a4347ff97e59ab4a5b51 (patch)
tree7e5807b3757ef89cf8e20308cf62a376c82f3cea /drivers/misc/sgi-xp
parenta45a0258d1f817b60fcd5bc67dc7ef692f4615bb (diff)
sgi-xp: open-code interruptible_sleep_on_timeout
interruptible_sleep_on_timeout is deprecated and going away soon. The use in the sgi-xp driver leaves me puzzled, so I'd prefer not to touch it. This patch replaces it with an open-coded prepare_to_wait and finish_wait pair, which should be completely equivalent, so it doesn't fix an existing race, but lets us get away with removing the function so we can not get any new users. In order to remove the typical sleep_on race, one would have to replace the call with wait_event_interruptible_timeout and add a condition to wait for. The fact that there is a one-jiffy timeout suggests that we don't actually expect to get woken up properly and the caller just uses this as a short sleeping function if it doesn't wake up properly. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Cc: Cliff Whickman <cpw@sgi.com> Acked-by: Robin Holt <robinmholt@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/sgi-xp')
-rw-r--r--drivers/misc/sgi-xp/xpc_channel.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/misc/sgi-xp/xpc_channel.c b/drivers/misc/sgi-xp/xpc_channel.c
index 652593fc486d..128d5615c804 100644
--- a/drivers/misc/sgi-xp/xpc_channel.c
+++ b/drivers/misc/sgi-xp/xpc_channel.c
@@ -828,6 +828,7 @@ enum xp_retval
828xpc_allocate_msg_wait(struct xpc_channel *ch) 828xpc_allocate_msg_wait(struct xpc_channel *ch)
829{ 829{
830 enum xp_retval ret; 830 enum xp_retval ret;
831 DEFINE_WAIT(wait);
831 832
832 if (ch->flags & XPC_C_DISCONNECTING) { 833 if (ch->flags & XPC_C_DISCONNECTING) {
833 DBUG_ON(ch->reason == xpInterrupted); 834 DBUG_ON(ch->reason == xpInterrupted);
@@ -835,7 +836,9 @@ xpc_allocate_msg_wait(struct xpc_channel *ch)
835 } 836 }
836 837
837 atomic_inc(&ch->n_on_msg_allocate_wq); 838 atomic_inc(&ch->n_on_msg_allocate_wq);
838 ret = interruptible_sleep_on_timeout(&ch->msg_allocate_wq, 1); 839 prepare_to_wait(&ch->msg_allocate_wq, &wait, TASK_INTERRUPTIBLE);
840 ret = schedule_timeout(1);
841 finish_wait(&ch->msg_allocate_wq, &wait);
839 atomic_dec(&ch->n_on_msg_allocate_wq); 842 atomic_dec(&ch->n_on_msg_allocate_wq);
840 843
841 if (ch->flags & XPC_C_DISCONNECTING) { 844 if (ch->flags & XPC_C_DISCONNECTING) {