aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hv/channel_mgmt.c
diff options
context:
space:
mode:
authorK. Y. Srinivasan <kys@microsoft.com>2013-03-15 15:25:44 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-03-15 15:11:51 -0400
commitc87059793dd02390b504b0292bdb024ffd68b822 (patch)
tree60c359bbb8d53947b92c322c2a9b88595b6320f2 /drivers/hv/channel_mgmt.c
parent1cac8cd4d146b60a7c70d778b5be928281b3b551 (diff)
Drivers: hv: vmbus: Handle channel rescind message correctly
Properly cleanup the channel state on receipt of the "offer rescind" message. Starting with ws2012, the host requires that the channel "relid" be properly cleaned up when the offer is rescinded. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/hv/channel_mgmt.c')
-rw-r--r--drivers/hv/channel_mgmt.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c
index ff1be167eb04..bad8128b283a 100644
--- a/drivers/hv/channel_mgmt.c
+++ b/drivers/hv/channel_mgmt.c
@@ -165,8 +165,19 @@ static void vmbus_process_rescind_offer(struct work_struct *work)
165 struct vmbus_channel *channel = container_of(work, 165 struct vmbus_channel *channel = container_of(work,
166 struct vmbus_channel, 166 struct vmbus_channel,
167 work); 167 work);
168 unsigned long flags;
169 struct vmbus_channel_relid_released msg;
168 170
169 vmbus_device_unregister(channel->device_obj); 171 vmbus_device_unregister(channel->device_obj);
172 memset(&msg, 0, sizeof(struct vmbus_channel_relid_released));
173 msg.child_relid = channel->offermsg.child_relid;
174 msg.header.msgtype = CHANNELMSG_RELID_RELEASED;
175 vmbus_post_msg(&msg, sizeof(struct vmbus_channel_relid_released));
176
177 spin_lock_irqsave(&vmbus_connection.channel_lock, flags);
178 list_del(&channel->listentry);
179 spin_unlock_irqrestore(&vmbus_connection.channel_lock, flags);
180 free_channel(channel);
170} 181}
171 182
172void vmbus_free_channels(void) 183void vmbus_free_channels(void)