From patchwork Fri Apr 15 02:42:33 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guenter Roeck X-Patchwork-Id: 8844431 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 BE0C09F3A0 for ; Fri, 15 Apr 2016 02:45:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 321EB202FF for ; Fri, 15 Apr 2016 02:45:01 +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 7EE1E20374 for ; Fri, 15 Apr 2016 02:44:59 +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 1aqtiT-0004Cz-PE; Fri, 15 Apr 2016 02:42:41 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aqtiS-0004Ct-Im for xen-devel@lists.xenproject.org; Fri, 15 Apr 2016 02:42:40 +0000 Received: from [193.109.254.147] by server-2.bemta-14.messagelabs.com id AA/DE-03279-F1550175; Fri, 15 Apr 2016 02:42:39 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrMIsWRWlGSWpSXmKPExsVyIfr4DF35UIF wg696Ft+3TGZyYPQ4/OEKSwBjFGtmXlJ+RQJrxu1Jd5kK1vNVnFjQzNzAuIGni5GTg0VgE4vE waN8XYxcHEICnxglfjV9ZAFJsAloSDRtncwIYosIhEocf7KNCaSIWaCLSWL71H9gRcICbhK3F uxlg5ikKnHrUjc7iM0r4Cjx4N4n5i5GDg4JATmJBRfSQcKcAk4SF25fYwQJCwGVTDqkDxKWEN CRmLv3AAuErSbxaMMydgg7SuLv7qssEFNMJJ58S4YIG0u8fLWAGcK2kvh9eA1Uq6HE/31XGCH sMInjcw4wQdhOErsmdkDVcEkcmDqPDcLmlzg8+x5UPZ/EvoUb2CYwii9gZFjFqFGcWlSWWqRr aKKXVJSZnlGSm5iZo2sI5OamFhcnpqfmJCYV6yXn525iBAZ+PQMD4w7G76c9DzFKcjApifJud hIIF+JLyk+pzEgszogvKs1JLT7EKMPBoSTB+zYYKCdYlJqeWpGWmQOMQZi0BAePkgjvcZA0b3 FBYm5xZjpE6hSjopQ4r0AIUEIAJJFRmgfXBov7S4yyUsK8jAwMDEI8BalFuZklqPKvGMU5GJW EeW+BjOfJzCuBm/4KaDET0OKyd7wgi0sSEVJSDYyp1zj4k/kTXs5csdHMnsfgkd0ic3ad2n16 rnIMS/cwrJj2i98/8aV9h71QcsYv7XtPjpl2bi2+or9MzNnd4py+aPgrzhxrP5s1YnnR4f+OS 4mHsywo+6fIxsN5q8/w0LvbpnXHVxrf27v20p6ly86EfbH6mcXbOa0or+d6asyvxz9XfIhfsV mJpTgj0VCLuag4EQBhKLZF9gIAAA== X-Env-Sender: linux@roeck-us.net X-Msg-Ref: server-16.tower-27.messagelabs.com!1460688157!35676611!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 39243 invoked from network); 15 Apr 2016 02:42:38 -0000 Received: from bh-25.webhostbox.net (HELO bh-25.webhostbox.net) (208.91.199.152) by server-16.tower-27.messagelabs.com with DHE-RSA-AES256-SHA encrypted SMTP; 15 Apr 2016 02:42:38 -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=SoOJTLk3N0q9IHn9uiCgZo/xJ5XoYFgUZfJNmNsJ2pM=; b=YlAj4fGhIot6Hu cGMLxceKukTvpgmMD7cdGu7Stu0S1CQUaqmj4iaMs87xDFZkcfWf/Xu6N5mgaczZjQc9jubYr5QMB 624EyBXQrvSloPdebnJ+6H3ERU5E3Vm88JbhIm7yE4oOzqZuKZ0gQywllTzaKA/CqdyM/c6hie1xa wmOUIyasT3aRP3nXSRGjnkm8wnUDDjkwxGsydIErxHPrzyBCJBcZ+faCSjXwVITOymUdPa0cjwmKw w5E4pCaUNKCZYN7uXsPHaCRlYxdJZCQ4+Soucjc/m5QPTbSJTwWgBQkxX3uRV0I7vcMPXhG4GpmwB iy/M1eKwtuVdY3AXIvBQ==; Received: from 108-223-40-66.lightspeed.sntcca.sbcglobal.net ([108.223.40.66]:32926 helo=localhost) by bh-25.webhostbox.net with esmtpa (Exim 4.86_1) (envelope-from ) id 1aqtiN-001AcY-W2; Fri, 15 Apr 2016 02:42:36 +0000 From: Guenter Roeck To: Russell King , Catalin Marinas Date: Thu, 14 Apr 2016 19:42:33 -0700 Message-Id: <1460688157-6551-3-git-send-email-linux@roeck-us.net> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1460688157-6551-1-git-send-email-linux@roeck-us.net> References: <1460688157-6551-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 v2 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. Acked-by: Arnd Bergmann Reviewed-by: Wolfram Sang Reviewed-by: Stefano Stabellini Signed-off-by: Guenter Roeck --- v2: Rebased to v4.6-rc3, added Reviewed/by/Acked-by tags 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);