From 564eb3a28390daed94bfa3b640f3d376a9027fd9 Mon Sep 17 00:00:00 2001 From: Daniel Mack Date: Sat, 18 Jan 2014 15:57:35 +0100 Subject: [PATCH] connection: add comment about wait_event --- connection.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/connection.c b/connection.c index 67e432a..9eb0bf9 100644 --- a/connection.c +++ b/connection.c @@ -1152,18 +1152,17 @@ int kdbus_conn_kmsg_send(struct kdbus_ep *ep, kdbus_conn_queue_insert(c, kmsg, NULL); mutex_unlock(&ep->bus->lock); - ret = kdbus_conn_queue_insert(conn_dst, kmsg, &offset); - if (ret < 0) - goto exit_unref; - - BUG_ON(reply_wait && reply_wake); - if (reply_wait) { u64 us = msg->timeout_ns; struct kdbus_cmd_recv recv = {}; do_div(us, 1000ULL); + /* + * Block until the reply arrives. reply_wait is left untouched + * by the timeout scans that might be conducted for other, + * asynchronous replies of conn_src. + */ if (!wait_event_interruptible_timeout(reply_wait->wait, !reply_wait->waiting, usecs_to_jiffies(us))) { -- 2.34.1