From patchwork Tue Sep 30 18:00:53 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guenter Roeck X-Patchwork-Id: 5006301 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 106B19F327 for ; Tue, 30 Sep 2014 18:07:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9EB8120225 for ; Tue, 30 Sep 2014 18:07:47 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E96182015D for ; Tue, 30 Sep 2014 18:07:45 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XZ1nl-0003Et-QN; Tue, 30 Sep 2014 18:05:29 +0000 Received: from mail-pd0-x22b.google.com ([2607:f8b0:400e:c02::22b]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XZ1kP-0007Px-3q for linux-arm-kernel@lists.infradead.org; Tue, 30 Sep 2014 18:02:01 +0000 Received: by mail-pd0-f171.google.com with SMTP id ft15so3790050pdb.16 for ; Tue, 30 Sep 2014 11:01:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=uk9PhDnqYd2VHty/au3bMVyIYyr5J/u7KX/H4dlb9Mo=; b=Y+UsaQkwNo+3j8tFz8Bu5jtJYoL8yb16x9RgRoRUL7jMsw5oQW1J6Y/IwquP1Xw0VR XfJfKBtTObXXnlvw+gipuOpoBsGMcank0x00X4eEZn+S8zW5HcKmZKUD/iq+E+fpDHi9 8Of1YXw+lVDSLJuzscQ62n1cZfx/SvnsR0ylY6ZFrFNw/OwhONveb7UYw1MU0PF83dA+ ocoJGsiW/TLV7c7WU6rRgdzumHRj4aSE8ZuixgRa7qq09IcZll+Swdt0Al5nEaV6DK1/ 70ghVjSTuAp7MxIoozpXKLQb8jxjAxuZCU4eUSqkkVt4USe88R55frO987lwSM9feDTU a0Bg== X-Received: by 10.68.223.103 with SMTP id qt7mr72959161pbc.9.1412100100812; Tue, 30 Sep 2014 11:01:40 -0700 (PDT) Received: from localhost (108-223-40-66.lightspeed.sntcca.sbcglobal.net. [108.223.40.66]) by mx.google.com with ESMTPSA id f2sm15799501pdd.25.2014.09.30.11.01.40 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 30 Sep 2014 11:01:40 -0700 (PDT) From: Guenter Roeck To: linux-kernel@vger.kernel.org Subject: [RFC PATCH 13/16] x86: support poweroff through poweroff handler call chain Date: Tue, 30 Sep 2014 11:00:53 -0700 Message-Id: <1412100056-15517-14-git-send-email-linux@roeck-us.net> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1412100056-15517-1-git-send-email-linux@roeck-us.net> References: <1412100056-15517-1-git-send-email-linux@roeck-us.net> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140930_110201_198253_B1AF23F1 X-CRM114-Status: GOOD ( 11.60 ) X-Spam-Score: -0.4 (/) Cc: linux-mips@linux-mips.org, linux-ia64@vger.kernel.org, linux-c6x-dev@linux-c6x.org, linux-parisc@vger.kernel.org, linux-pm@vger.kernel.org, linux-sh@vger.kernel.org, Ingo Molnar , Guenter Roeck , "H. Peter Anvin" , xen-devel@lists.xenproject.org, Thomas Gleixner , linux-metag@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_NONE,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham 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 The kernel core now supports a poweroff handler call chain to remove power from the system. Call it if pm_power_off is set to NULL. Cc: Thomas Gleixner Cc: Ingo Molnar Cc: H. Peter Anvin Signed-off-by: Guenter Roeck --- arch/x86/kernel/reboot.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c index 17962e6..c5514aa 100644 --- a/arch/x86/kernel/reboot.c +++ b/arch/x86/kernel/reboot.c @@ -651,6 +651,10 @@ static void native_machine_power_off(void) if (!reboot_force) machine_shutdown(); pm_power_off(); + } else { + if (!reboot_force) + machine_shutdown(); + do_kernel_poweroff(); } /* A fallback in case there is no PM info available */ tboot_shutdown(TB_SHUTDOWN_HALT);