From patchwork Fri Apr 8 12:53:55 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guenter Roeck X-Patchwork-Id: 8783461 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 077F29F71A for ; Fri, 8 Apr 2016 12:56:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 34F6B202B8 for ; Fri, 8 Apr 2016 12:56:07 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 554BE2027D for ; Fri, 8 Apr 2016 12:56:06 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aoVvI-00088z-Mp; Fri, 08 Apr 2016 12:54:04 +0000 Received: from mail6.bemta6.messagelabs.com ([85.158.143.247]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aoVvH-00088s-Dk for xen-devel@lists.xenproject.org; Fri, 08 Apr 2016 12:54:03 +0000 Received: from [85.158.143.35] by server-3.bemta-6.messagelabs.com id 31/25-07120-AE9A7075; Fri, 08 Apr 2016 12:54:02 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrMIsWRWlGSWpSXmKPExsVyIfr4DN1XK9n DDTp7RSy+b5nM5MDocfjDFZYAxijWzLyk/IoE1oy1E96zF5zlqehdk9PA+Iiri5GLg0VgE4vE hkOH2UAcIYFPjBJTn7QCOZwcbAIaEk1bJzOC2CICoRLHn2xjAiliFuhiktg+9R8LSEJYwFni1 NoZzCA2i4CqxNPFrWANvAKOEo0df4FqODgkBOQkFlxIBzE5BZwkNu8LA6kQAqo4MOk9O4gtIa AjMXfvARYIW03i0YZlUPEoib+7r0JNMZF48i0ZImws8fLVAmYI20ri9+E1UK2GEv/3XWGEsMM kjs85wARhO0nsmtgBVcMlcWDqPDYIm1/i8Ox7UPV8EvsWbmCbwCi+gJFhFaN6cWpRWWqRrpFe UlFmekZJbmJmjq6hgZlebmpxcWJ6ak5iUrFecn7uJkZg4DMAwQ7GZX+dDjFKcjApifIy9LKHC /El5adUZiQWZ8QXleakFh9ilOHgUJLgnb0CKCdYlJqeWpGWmQOMQZi0BAePkgjvTpA0b3FBYm 5xZjpE6hSjopQ473KQhABIIqM0D64NFveXGGWlhHkZgQ4R4ilILcrNLEGVf8UozsGoJMx7HmQ KT2ZeCdz0V0CLmYAWX+BnA1lckoiQkmpgLA/jM9vmaZKYL5pRG1GYaRkiGfRsn+KMJ9GNn49N 992ba6Gvx3JT6m3kpwXnrljf8XlkuUrHJHMeg1iZWtjCoikuE7crOKb31Ov7F23zEsrhvHp1E sOcmOviWpxdOqeW7tt3IPjM9faJsUfYOPIEufi337WZ/u7XvrW9+cwm11pVVC9cDnunxFKckW ioxVxUnAgAw/i6cfYCAAA= X-Env-Sender: linux@roeck-us.net X-Msg-Ref: server-7.tower-21.messagelabs.com!1460120041!8359059!1 X-Originating-IP: [208.91.199.152] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 8.28; banners=-,-,- X-VirusChecked: Checked Received: (qmail 37738 invoked from network); 8 Apr 2016 12:54:02 -0000 Received: from bh-25.webhostbox.net (HELO bh-25.webhostbox.net) (208.91.199.152) by server-7.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted SMTP; 8 Apr 2016 12:54:02 -0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=roeck-us.net; s=default; h=References:In-Reply-To:Message-Id:Date:Subject: Cc:To:From; bh=69eg/nHEL4P0x8h3q85mb/LVtJZ8FEFl/C8Eoj3AaSc=; b=WedHP5JZHpqjqR /zHojDWzQgoO+lxYwY/hOn1m6hZ/wy8dDp/Rn8wgEK0/xvHV0XnWpM79iUvSGBvE3ygOPEB6aTkdu oNofa+TqThf04iee85gnvFCJDe0DhFVzgv9SHW3J7A+eTP4otUwaeTv/beBwTa+tCzuXe4svN+i8o 7/o4Ooz3m9zQoBAwClYErlWfV6W5Mg+12Gj3ptC5EMUns2qHdmkB+Qcm0LdB5KNoyU4LDJ0aAJ7N8 4xg0KFQ1XnRcghbUFYfCwgLw6lafRdRbv7CWtOaIpTySn6X/w6ejtgBfUbyQeFamiJ/IxwGt69wek ABuoV6Ca7Bg6v9Qowdzg==; Received: from 108-223-40-66.lightspeed.sntcca.sbcglobal.net ([108.223.40.66]:53840 helo=localhost) by bh-25.webhostbox.net with esmtpa (Exim 4.86_1) (envelope-from ) id 1aoVvD-001ynE-No; Fri, 08 Apr 2016 12:54:00 +0000 From: Guenter Roeck To: Russell King , Catalin Marinas Date: Fri, 8 Apr 2016 05:53:55 -0700 Message-Id: <1460120039-2497-3-git-send-email-linux@roeck-us.net> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1460120039-2497-1-git-send-email-linux@roeck-us.net> References: <1460120039-2497-1-git-send-email-linux@roeck-us.net> X-Authenticated_sender: guenter@roeck-us.net X-OutGoing-Spam-Status: No, score=-1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bh-25.webhostbox.net X-AntiAbuse: Original Domain - lists.xenproject.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - roeck-us.net X-Get-Message-Sender-Via: bh-25.webhostbox.net: authenticated_id: guenter@roeck-us.net X-Authenticated-Sender: bh-25.webhostbox.net: guenter@roeck-us.net X-Source: X-Source-Args: X-Source-Dir: Cc: Stefano Stabellini , Wolfram Sang , linux-kernel@vger.kernel.org, Geert Uytterhoeven , linux-arm-kernel@lists.infradead.org, xen-devel@lists.xenproject.org, Guenter Roeck Subject: [Xen-devel] [PATCH 2/6] ARM: xen: Register with kernel restart handler X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Register with kernel restart handler instead of setting arm_pm_restart directly. Select a high priority of 192 to ensure that default restart handlers are replaced if Xen is running. Signed-off-by: Guenter Roeck Reviewed-by: Stefano Stabellini --- arch/arm/xen/enlighten.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c index 75cd7345c654..76a1d12fd27e 100644 --- a/arch/arm/xen/enlighten.c +++ b/arch/arm/xen/enlighten.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -193,14 +194,22 @@ after_register_vcpu_info: put_cpu(); } -static void xen_restart(enum reboot_mode reboot_mode, const char *cmd) +static int xen_restart(struct notifier_block *nb, unsigned long action, + void *data) { struct sched_shutdown r = { .reason = SHUTDOWN_reboot }; int rc; rc = HYPERVISOR_sched_op(SCHEDOP_shutdown, &r); BUG_ON(rc); + + return NOTIFY_DONE; } +static struct notifier_block xen_restart_nb = { + .notifier_call = xen_restart, + .priority = 192, +}; + static void xen_power_off(void) { struct sched_shutdown r = { .reason = SHUTDOWN_poweroff }; @@ -370,7 +379,7 @@ static int __init xen_pm_init(void) return -ENODEV; pm_power_off = xen_power_off; - arm_pm_restart = xen_restart; + register_restart_handler(&xen_restart_nb); if (!xen_initial_domain()) { struct timespec64 ts; xen_read_wallclock(&ts);