linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "K. Y. Srinivasan" <kys@microsoft.com>
To: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org,
	devel@linuxdriverproject.org, olaf@aepfle.de, apw@canonical.com,
	jasowang@redhat.com
Cc: "K. Y. Srinivasan" <kys@microsoft.com>
Subject: [PATCH RESEND 6/6] Drivers: hv: vmbus: Handle channel rescind message correctly
Date: Tue, 12 Mar 2013 11:02:22 -0700	[thread overview]
Message-ID: <1363111342-30242-6-git-send-email-kys@microsoft.com> (raw)
In-Reply-To: <1363111342-30242-1-git-send-email-kys@microsoft.com>

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>
---
 drivers/hv/channel_mgmt.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c
index ff1be16..bad8128 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)
 	struct vmbus_channel *channel = container_of(work,
 						     struct vmbus_channel,
 						     work);
+	unsigned long flags;
+	struct vmbus_channel_relid_released msg;
 
 	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)
-- 
1.7.4.1


  parent reply	other threads:[~2013-03-12 17:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-12 18:01 [PATCH RESEND 0/6] Drivers: hv K. Y. Srinivasan
2013-03-12 18:02 ` [PATCH RESEND 1/6] Drivers: hv: balloon: Do not request completion notification K. Y. Srinivasan
2013-03-12 18:02   ` [PATCH RESEND 2/6] Drivers: hv: balloon: Execute balloon inflation in a separate context K. Y. Srinivasan
2013-03-12 18:02   ` [PATCH RESEND 3/6] Drivers: hv: balloon: Execute hot-add code " K. Y. Srinivasan
2013-03-12 18:02   ` [PATCH RESEND 4/6] Drivers: hv: balloon: Make the balloon driver not unloadable K. Y. Srinivasan
2013-03-12 18:02   ` [PATCH RESEND 5/6] Drivers: hv: balloon: Implement hot-add functionality K. Y. Srinivasan
2013-03-13 16:50     ` Olaf Hering
2013-03-13 17:25       ` KY Srinivasan
2013-03-12 18:02   ` K. Y. Srinivasan [this message]
2013-03-14 20:38 [PATCH RESEND 0/6] Drivers: hv K. Y. Srinivasan
2013-03-14 20:39 ` [PATCH RESEND 1/6] Drivers: hv: balloon: Do not request completion notification K. Y. Srinivasan
2013-03-14 20:39   ` [PATCH RESEND 6/6] Drivers: hv: vmbus: Handle channel rescind message correctly K. Y. Srinivasan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1363111342-30242-6-git-send-email-kys@microsoft.com \
    --to=kys@microsoft.com \
    --cc=apw@canonical.com \
    --cc=devel@linuxdriverproject.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jasowang@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=olaf@aepfle.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).