]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
Revert "Drivers: hv: vmbus: Raise retry/wait limits in vmbus_post_msg()"
authorTim Gardner <tim.gardner@canonical.com>
Tue, 28 Mar 2017 20:20:42 +0000 (14:20 -0600)
committerTim Gardner <tim.gardner@canonical.com>
Tue, 28 Mar 2017 20:33:42 +0000 (14:33 -0600)
BugLink: http://bugs.launchpad.net/bugs/1676635
This reverts commit 816725f684dd5d018c4314f79797d0ea8eccdd9b.

Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
drivers/hv/channel.c
drivers/hv/channel_mgmt.c
drivers/hv/connection.c
drivers/hv/hyperv_vmbus.h

index be34547cdb681e9f2d34f05404067e1c4fdf5643..f63a9b809f0d328b7b41e9c899d474208c9ad05e 100644 (file)
@@ -182,7 +182,7 @@ int vmbus_open(struct vmbus_channel *newchannel, u32 send_ringbuffer_size,
        spin_unlock_irqrestore(&vmbus_connection.channelmsg_lock, flags);
 
        ret = vmbus_post_msg(open_msg,
-                            sizeof(struct vmbus_channel_open_channel), true);
+                              sizeof(struct vmbus_channel_open_channel));
 
        if (ret != 0) {
                err = ret;
@@ -239,7 +239,7 @@ int vmbus_send_tl_connect_request(const uuid_le *shv_guest_servie_id,
        conn_msg.guest_endpoint_id = *shv_guest_servie_id;
        conn_msg.host_service_id = *shv_host_servie_id;
 
-       return vmbus_post_msg(&conn_msg, sizeof(conn_msg), true);
+       return vmbus_post_msg(&conn_msg, sizeof(conn_msg));
 }
 EXPORT_SYMBOL_GPL(vmbus_send_tl_connect_request);
 
@@ -426,7 +426,7 @@ int vmbus_establish_gpadl(struct vmbus_channel *channel, void *kbuffer,
        spin_unlock_irqrestore(&vmbus_connection.channelmsg_lock, flags);
 
        ret = vmbus_post_msg(gpadlmsg, msginfo->msgsize -
-                            sizeof(*msginfo), true);
+                              sizeof(*msginfo));
        if (ret != 0)
                goto cleanup;
 
@@ -440,8 +440,8 @@ int vmbus_establish_gpadl(struct vmbus_channel *channel, void *kbuffer,
                gpadl_body->gpadl = next_gpadl_handle;
 
                ret = vmbus_post_msg(gpadl_body,
-                                    submsginfo->msgsize - sizeof(*submsginfo),
-                                    true);
+                                    submsginfo->msgsize -
+                                    sizeof(*submsginfo));
                if (ret != 0)
                        goto cleanup;
 
@@ -498,8 +498,8 @@ int vmbus_teardown_gpadl(struct vmbus_channel *channel, u32 gpadl_handle)
        list_add_tail(&info->msglistentry,
                      &vmbus_connection.chn_msg_list);
        spin_unlock_irqrestore(&vmbus_connection.channelmsg_lock, flags);
-       ret = vmbus_post_msg(msg, sizeof(struct vmbus_channel_gpadl_teardown),
-                            true);
+       ret = vmbus_post_msg(msg,
+                              sizeof(struct vmbus_channel_gpadl_teardown));
 
        if (ret)
                goto post_msg_err;
@@ -575,8 +575,7 @@ static int vmbus_close_internal(struct vmbus_channel *channel)
        msg->header.msgtype = CHANNELMSG_CLOSECHANNEL;
        msg->child_relid = channel->offermsg.child_relid;
 
-       ret = vmbus_post_msg(msg, sizeof(struct vmbus_channel_close_channel),
-                            true);
+       ret = vmbus_post_msg(msg, sizeof(struct vmbus_channel_close_channel));
 
        if (ret) {
                pr_err("Close failed: close post msg return is %d\n", ret);
index 0af7e39006c8e96e942243de974cdf3308a64fbe..689cbbcc30a8ec0216130ebc3ac970a7fb22a31e 100644 (file)
@@ -344,8 +344,7 @@ static void vmbus_release_relid(u32 relid)
        memset(&msg, 0, sizeof(struct vmbus_channel_relid_released));
        msg.child_relid = relid;
        msg.header.msgtype = CHANNELMSG_RELID_RELEASED;
-       vmbus_post_msg(&msg, sizeof(struct vmbus_channel_relid_released),
-                      true);
+       vmbus_post_msg(&msg, sizeof(struct vmbus_channel_relid_released));
 }
 
 void hv_event_tasklet_disable(struct vmbus_channel *channel)
@@ -752,8 +751,7 @@ void vmbus_initiate_unload(bool crash)
        init_completion(&vmbus_connection.unload_event);
        memset(&hdr, 0, sizeof(struct vmbus_channel_message_header));
        hdr.msgtype = CHANNELMSG_UNLOAD;
-       vmbus_post_msg(&hdr, sizeof(struct vmbus_channel_message_header),
-                      !crash);
+       vmbus_post_msg(&hdr, sizeof(struct vmbus_channel_message_header));
 
        /*
         * vmbus_initiate_unload() is also called on crash and the crash can be
@@ -1143,8 +1141,8 @@ int vmbus_request_offers(void)
        msg->msgtype = CHANNELMSG_REQUESTOFFERS;
 
 
-       ret = vmbus_post_msg(msg, sizeof(struct vmbus_channel_message_header),
-                            true);
+       ret = vmbus_post_msg(msg,
+                              sizeof(struct vmbus_channel_message_header));
        if (ret != 0) {
                pr_err("Unable to request offers - %d\n", ret);
 
index 9b72ebcd37bcd271497d662e765edb3755a9110e..6ce8b874e833dbd7f0b630f97d9bd4e6790e6831 100644 (file)
@@ -111,8 +111,7 @@ static int vmbus_negotiate_version(struct vmbus_channel_msginfo *msginfo,
        spin_unlock_irqrestore(&vmbus_connection.channelmsg_lock, flags);
 
        ret = vmbus_post_msg(msg,
-                            sizeof(struct vmbus_channel_initiate_contact),
-                            true);
+                              sizeof(struct vmbus_channel_initiate_contact));
        if (ret != 0) {
                spin_lock_irqsave(&vmbus_connection.channelmsg_lock, flags);
                list_del(&msginfo->msglistentry);
@@ -436,7 +435,7 @@ void vmbus_on_event(unsigned long data)
 /*
  * vmbus_post_msg - Send a msg on the vmbus's message connection
  */
-int vmbus_post_msg(void *buffer, size_t buflen, bool can_sleep)
+int vmbus_post_msg(void *buffer, size_t buflen)
 {
        union hv_connection_id conn_id;
        int ret = 0;
@@ -451,7 +450,7 @@ int vmbus_post_msg(void *buffer, size_t buflen, bool can_sleep)
         * insufficient resources. Retry the operation a couple of
         * times before giving up.
         */
-       while (retries < 100) {
+       while (retries < 20) {
                ret = hv_post_message(conn_id, 1, buffer, buflen);
 
                switch (ret) {
@@ -474,14 +473,8 @@ int vmbus_post_msg(void *buffer, size_t buflen, bool can_sleep)
                }
 
                retries++;
-               if (can_sleep && usec > 1000)
-                       msleep(usec / 1000);
-               else if (usec < MAX_UDELAY_MS * 1000)
-                       udelay(usec);
-               else
-                       mdelay(usec / 1000);
-
-               if (usec < 256000)
+               udelay(usec);
+               if (usec < 2048)
                        usec *= 2;
        }
        return ret;
index 27982df20421e57fa2fccdcbf603b4e2d4c264c6..0675b395ce5c47f284dec3c86b02133086e86cf9 100644 (file)
@@ -683,7 +683,7 @@ void vmbus_free_channels(void);
 int vmbus_connect(void);
 void vmbus_disconnect(void);
 
-int vmbus_post_msg(void *buffer, size_t buflen, bool can_sleep);
+int vmbus_post_msg(void *buffer, size_t buflen);
 
 void vmbus_on_event(unsigned long data);
 void vmbus_on_msg_dpc(unsigned long data);