X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=drivers%2Fhv%2Fconnection.c;h=3dc5a9c7fad6edda9fcaac0ecda2a24ca96822c5;hb=cc80fe0eefbbbd7b4e32f631bb2fa639d76af075;hp=4fc2e8836e60d282d36e6fbf6d9b563aab274b8f;hpb=a52bd79e3ef683808e129c7627e8878ea0309459;p=karo-tx-linux.git diff --git a/drivers/hv/connection.c b/drivers/hv/connection.c index 4fc2e8836e60..3dc5a9c7fad6 100644 --- a/drivers/hv/connection.c +++ b/drivers/hv/connection.c @@ -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; }