]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/hv/connection.c
Merge tag 'nfsd-4.5' of git://linux-nfs.org/~bfields/linux
[karo-tx-linux.git] / drivers / hv / connection.c
index 4fc2e8836e60d282d36e6fbf6d9b563aab274b8f..3dc5a9c7fad6edda9fcaac0ecda2a24ca96822c5 100644 (file)
@@ -83,10 +83,13 @@ static int vmbus_negotiate_version(struct vmbus_channel_msginfo *msginfo,
        msg->interrupt_page = virt_to_phys(vmbus_connection.int_page);
        msg->monitor_page1 = virt_to_phys(vmbus_connection.monitor_pages[0]);
        msg->monitor_page2 = virt_to_phys(vmbus_connection.monitor_pages[1]);
-       if (version >= VERSION_WIN8_1) {
-               msg->target_vcpu = hv_context.vp_index[get_cpu()];
-               put_cpu();
-       }
+       /*
+        * We want all channel messages to be delivered on CPU 0.
+        * This has been the behavior pre-win8. This is not
+        * perf issue and having all channel messages delivered on CPU 0
+        * would be ok.
+        */
+       msg->target_vcpu = 0;
 
        /*
         * Add to list before we send the request since we may
@@ -146,7 +149,7 @@ int vmbus_connect(void)
        spin_lock_init(&vmbus_connection.channelmsg_lock);
 
        INIT_LIST_HEAD(&vmbus_connection.chn_list);
-       spin_lock_init(&vmbus_connection.channel_lock);
+       mutex_init(&vmbus_connection.channel_mutex);
 
        /*
         * Setup the vmbus event connection for channel interrupt
@@ -282,11 +285,10 @@ struct vmbus_channel *relid2channel(u32 relid)
 {
        struct vmbus_channel *channel;
        struct vmbus_channel *found_channel  = NULL;
-       unsigned long flags;
        struct list_head *cur, *tmp;
        struct vmbus_channel *cur_sc;
 
-       spin_lock_irqsave(&vmbus_connection.channel_lock, flags);
+       mutex_lock(&vmbus_connection.channel_mutex);
        list_for_each_entry(channel, &vmbus_connection.chn_list, listentry) {
                if (channel->offermsg.child_relid == relid) {
                        found_channel = channel;
@@ -305,7 +307,7 @@ struct vmbus_channel *relid2channel(u32 relid)
                        }
                }
        }
-       spin_unlock_irqrestore(&vmbus_connection.channel_lock, flags);
+       mutex_unlock(&vmbus_connection.channel_mutex);
 
        return found_channel;
 }