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, davem@davemloft.net, jkosina@suse.cz,
James.Bottomley@HansenPartnership.com
Cc: "K. Y. Srinivasan" <kys@microsoft.com>
Subject: [PATCH 6/6] Drivers: hv: Execute shutdown in a thread context
Date: Wed, 23 Jan 2013 17:42:45 -0800 [thread overview]
Message-ID: <1358991765-22715-6-git-send-email-kys@microsoft.com> (raw)
In-Reply-To: <1358991765-22715-1-git-send-email-kys@microsoft.com>
Execute the shutdown code in a thread context. With recent changes made to the
shutdown code, shutdown code cannot be invoked from an interrupt context.
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
---
drivers/hv/hv_util.c | 12 +++++++++++-
1 files changed, 11 insertions(+), 1 deletions(-)
diff --git a/drivers/hv/hv_util.c b/drivers/hv/hv_util.c
index 8b7868a..aceb67f 100644
--- a/drivers/hv/hv_util.c
+++ b/drivers/hv/hv_util.c
@@ -49,6 +49,16 @@ static struct hv_util_service util_kvp = {
.util_deinit = hv_kvp_deinit,
};
+static void perform_shutdown(struct work_struct *dummy)
+{
+ orderly_poweroff(true);
+}
+
+/*
+ * Perform the shutdown operation in a thread context.
+ */
+static DECLARE_WORK(shutdown_work, perform_shutdown);
+
static void shutdown_onchannelcallback(void *context)
{
struct vmbus_channel *channel = context;
@@ -106,7 +116,7 @@ static void shutdown_onchannelcallback(void *context)
}
if (execute_shutdown == true)
- orderly_poweroff(true);
+ schedule_work(&shutdown_work);
}
/*
--
1.7.4.1
next prev parent reply other threads:[~2013-01-24 1:16 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-24 1:42 [PATCH 0/6] Drivers: hv: Consolidate GUID definitions K. Y. Srinivasan
2013-01-24 1:42 ` [PATCH 1/6] Drivers: hv: vmbus: Consolidate all offer GUID definitions in hyperv.h K. Y. Srinivasan
2013-01-24 1:42 ` [PATCH 2/6] Drivers: hv: Use consolidated GUID definitions K. Y. Srinivasan
2013-01-24 1:42 ` [PATCH 3/6] Drivers: net: hyperv: Use the consolidated GUID definition K. Y. Srinivasan
2013-01-24 1:42 ` [PATCH 4/6] Drivers: scsi: storvsc: " K. Y. Srinivasan
2013-01-24 1:42 ` [PATCH 5/6] Drivers: hid: hid-hyperv: Use consolidated GUID definitions K. Y. Srinivasan
2013-01-24 10:11 ` Jiri Kosina
2013-01-24 14:51 ` Greg KH
2013-01-24 1:42 ` K. Y. Srinivasan [this message]
2013-01-24 10:09 ` [PATCH 6/6] Drivers: hv: Execute shutdown in a thread context Jiri Kosina
2013-01-24 17:06 ` KY Srinivasan
2013-01-24 17:17 ` gregkh
2013-01-24 17:23 ` KY Srinivasan
2013-02-09 0:31 ` KY Srinivasan
2013-02-09 0:44 ` gregkh
2013-02-09 0:55 ` KY Srinivasan
2013-03-01 15:15 ` KY Srinivasan
2013-03-01 16:11 ` gregkh
2013-03-01 18:40 ` KY 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=1358991765-22715-6-git-send-email-kys@microsoft.com \
--to=kys@microsoft.com \
--cc=James.Bottomley@HansenPartnership.com \
--cc=apw@canonical.com \
--cc=davem@davemloft.net \
--cc=devel@linuxdriverproject.org \
--cc=gregkh@linuxfoundation.org \
--cc=jasowang@redhat.com \
--cc=jkosina@suse.cz \
--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).