Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c8705979 authored by K. Y. Srinivasan's avatar K. Y. Srinivasan Committed by Greg Kroah-Hartman
Browse files

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: default avatarK. Y. Srinivasan <kys@microsoft.com>
Reviewed-by: default avatarHaiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 1cac8cd4
Loading
Loading
Loading
Loading
+11 −0
Original line number Original line Diff line number Diff line
@@ -165,8 +165,19 @@ static void vmbus_process_rescind_offer(struct work_struct *work)
	struct vmbus_channel *channel = container_of(work,
	struct vmbus_channel *channel = container_of(work,
						     struct vmbus_channel,
						     struct vmbus_channel,
						     work);
						     work);
	unsigned long flags;
	struct vmbus_channel_relid_released msg;


	vmbus_device_unregister(channel->device_obj);
	vmbus_device_unregister(channel->device_obj);
	memset(&msg, 0, sizeof(struct vmbus_channel_relid_released));
	msg.child_relid = channel->offermsg.child_relid;
	msg.header.msgtype = CHANNELMSG_RELID_RELEASED;
	vmbus_post_msg(&msg, sizeof(struct vmbus_channel_relid_released));

	spin_lock_irqsave(&vmbus_connection.channel_lock, flags);
	list_del(&channel->listentry);
	spin_unlock_irqrestore(&vmbus_connection.channel_lock, flags);
	free_channel(channel);
}
}


void vmbus_free_channels(void)
void vmbus_free_channels(void)