Merge tag 'iwlwifi-for-kalle-2015-04-28' of https://git.kernel.org/pub/scm/linux...
[cascardo/linux.git] / drivers / hv / connection.c
index 8bcd307..b27220a 100644 (file)
@@ -270,7 +270,7 @@ static struct vmbus_channel *pcpu_relid2channel(u32 relid)
  * relid2channel - Get the channel object given its
  * child relative id (ie channel id)
  */
-struct vmbus_channel *relid2channel(u32 relid, bool rescind)
+struct vmbus_channel *relid2channel(u32 relid)
 {
        struct vmbus_channel *channel;
        struct vmbus_channel *found_channel  = NULL;
@@ -282,8 +282,6 @@ struct vmbus_channel *relid2channel(u32 relid, bool rescind)
        list_for_each_entry(channel, &vmbus_connection.chn_list, listentry) {
                if (channel->offermsg.child_relid == relid) {
                        found_channel = channel;
-                       if (rescind)
-                               found_channel->rescind = true;
                        break;
                } else if (!list_empty(&channel->sc_list)) {
                        /*
@@ -294,8 +292,6 @@ struct vmbus_channel *relid2channel(u32 relid, bool rescind)
                                                        sc_list);
                                if (cur_sc->offermsg.child_relid == relid) {
                                        found_channel = cur_sc;
-                                       if (rescind)
-                                               found_channel->rescind = true;
                                        break;
                                }
                        }
@@ -426,6 +422,7 @@ int vmbus_post_msg(void *buffer, size_t buflen)
        union hv_connection_id conn_id;
        int ret = 0;
        int retries = 0;
+       u32 msec = 1;
 
        conn_id.asu32 = 0;
        conn_id.u.id = VMBUS_MESSAGE_CONNECTION_ID;
@@ -435,7 +432,7 @@ int vmbus_post_msg(void *buffer, size_t buflen)
         * insufficient resources. Retry the operation a couple of
         * times before giving up.
         */
-       while (retries < 10) {
+       while (retries < 20) {
                ret = hv_post_message(conn_id, 1, buffer, buflen);
 
                switch (ret) {
@@ -458,7 +455,9 @@ int vmbus_post_msg(void *buffer, size_t buflen)
                }
 
                retries++;
-               msleep(1000);
+               msleep(msec);
+               if (msec < 2048)
+                       msec *= 2;
        }
        return ret;
 }