From patchwork Wed Jul 17 22:46:41 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamal Mostafa X-Patchwork-Id: 259934 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id 05C142C0091 for ; Thu, 18 Jul 2013 09:06:17 +1000 (EST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1Uzamo-00043y-Gl; Wed, 17 Jul 2013 23:05:30 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1UzacB-000896-SC for kernel-team@lists.ubuntu.com; Wed, 17 Jul 2013 22:54:31 +0000 Received: from c-67-160-231-162.hsd1.ca.comcast.net ([67.160.231.162] helo=fourier) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1UzaWc-0008EZ-WF; Wed, 17 Jul 2013 22:48:47 +0000 Received: from kamal by fourier with local (Exim 4.80) (envelope-from ) id 1UzaWa-0002Os-Ph; Wed, 17 Jul 2013 15:48:44 -0700 From: Kamal Mostafa To: linux-kernel@vger.kernel.org, stable@vger.kernel.org, kernel-team@lists.ubuntu.com Subject: [PATCH 069/145] Drivers: hv: Execute shutdown in a thread context Date: Wed, 17 Jul 2013 15:46:41 -0700 Message-Id: <1374101277-7915-70-git-send-email-kamal@canonical.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1374101277-7915-1-git-send-email-kamal@canonical.com> References: <1374101277-7915-1-git-send-email-kamal@canonical.com> X-Extended-Stable: 3.8 Cc: Greg Kroah-Hartman , "K. Y. Srinivasan" X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.14 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: kernel-team-bounces@lists.ubuntu.com 3.8.13.5 -stable review patch. If anyone has any objections, please let me know. ------------------ From: "K. Y. Srinivasan" commit 3dd6cb497198a0533a2530b6a345c60c9a29b9bc upstream. 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 Reviewed-by: Haiyang Zhang Signed-off-by: Greg Kroah-Hartman Cc: Joseph Salisbury Signed-off-by: Luis Henriques --- drivers/hv/hv_util.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/hv/hv_util.c b/drivers/hv/hv_util.c index a0667de..c64be4f 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); } /*