]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/hv/connection.c
Merge branches 'acpi-spcr', 'acpi-osi', 'acpi-bus', 'acpi-scan' and 'acpi-misc'
[karo-tx-linux.git] / drivers / hv / connection.c
index fce27fb141cc618d99099f569d1d5a63ac7f53f9..59c11ff90d1285addd24faa205b4b589ab4e646f 100644 (file)
@@ -93,10 +93,13 @@ static int vmbus_negotiate_version(struct vmbus_channel_msginfo *msginfo,
         * all the CPUs. This is needed for kexec to work correctly where
         * the CPU attempting to connect may not be CPU 0.
         */
-       if (version >= VERSION_WIN8_1)
+       if (version >= VERSION_WIN8_1) {
                msg->target_vcpu = hv_context.vp_index[smp_processor_id()];
-       else
+               vmbus_connection.connect_cpu = smp_processor_id();
+       } else {
                msg->target_vcpu = 0;
+               vmbus_connection.connect_cpu = 0;
+       }
 
        /*
         * Add to list before we send the request since we may
@@ -370,7 +373,7 @@ int vmbus_post_msg(void *buffer, size_t buflen, bool can_sleep)
                        break;
                case HV_STATUS_INSUFFICIENT_MEMORY:
                case HV_STATUS_INSUFFICIENT_BUFFERS:
-                       ret = -ENOMEM;
+                       ret = -ENOBUFS;
                        break;
                case HV_STATUS_SUCCESS:
                        return ret;
@@ -387,7 +390,7 @@ int vmbus_post_msg(void *buffer, size_t buflen, bool can_sleep)
                else
                        mdelay(usec / 1000);
 
-               if (usec < 256000)
+               if (retries < 22)
                        usec *= 2;
        }
        return ret;