From patchwork Thu Oct 31 06:27:11 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Domenico Andreoli X-Patchwork-Id: 3119431 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id F3E0BBF924 for ; Thu, 31 Oct 2013 07:40:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2A99820383 for ; Thu, 31 Oct 2013 07:40:45 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6974D2037D for ; Thu, 31 Oct 2013 07:40:40 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Vblo8-0005g1-Jz; Thu, 31 Oct 2013 06:32:42 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VblnM-0008Lc-AV; Thu, 31 Oct 2013 06:31:52 +0000 Received: from mail-ea0-x234.google.com ([2a00:1450:4013:c01::234]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Vblm2-0008Br-U0 for linux-arm-kernel@lists.infradead.org; Thu, 31 Oct 2013 06:30:41 +0000 Received: by mail-ea0-f180.google.com with SMTP id l9so936877eaj.25 for ; Wed, 30 Oct 2013 23:30:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:user-agent:date:from:to:cc:subject:references :content-disposition; bh=ZAwsEBwTDoDOvS8+cPqDOv9skUqtF23KoX7IRLTfU+w=; b=FZh8Bo0+yzLFUv3l62dCjxonHXbpHpgJa8Q2h9yHQlloxpzoHTviY1zCFJOtt0yytL EUZfp6ljQzApJlhAayV9HtBSivQ9ZD4iCogwfSAPaDawY3Hi9wUoKz4zuYZqKvQ3bIqr 1uF77J4EpMiDbOraifADWSZJNDHu05BiBWSopX6vQnZOUGxbSQHDTb7cZSfNg69PQIIf cD0XnxTGbjJNJivycXYrjPeoe9LYNTeTotTbR2wPNFnX2kXGt0WB79f3PMsX8gbh1cIk /KfL4iym+acua59bXQd0vsZ2gP7utxIrTyGxhFVO7IDVSuZh8NfZw+ntvWb4Qahpdvnp /bRQ== X-Received: by 10.14.208.134 with SMTP id q6mr116057eeo.147.1383201002605; Wed, 30 Oct 2013 23:30:02 -0700 (PDT) Received: from shock.dandreoli.com (j115181.upc-j.chello.nl. [24.132.115.181]) by mx.google.com with ESMTPSA id e13sm4474215eeu.4.2013.10.30.23.30.00 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 30 Oct 2013 23:30:01 -0700 (PDT) Received: by shock.dandreoli.com (Postfix, from userid 1000) id 25F86340268; Thu, 31 Oct 2013 07:29:59 +0100 (CET) Message-Id: <20131031062958.848317356@linux.com> User-Agent: quilt/0.60-1 Date: Thu, 31 Oct 2013 07:27:11 +0100 From: Domenico Andreoli To: linux-arch@vger.kernel.org Subject: [PATCH 03/11] ARM64: use the common machine reset handling References: <20131031062708.520968323@linux.com> Content-Disposition: inline; filename=arm64-machine-reset.patch X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131031_023031_172228_58E2CAE4 X-CRM114-Status: GOOD ( 13.87 ) X-Spam-Score: -1.9 (-) Cc: Russell King , Arnd Bergmann , Catalin Marinas , Will Deacon , Ralf Baechle , Domenico Andreoli , linux-mips@lvger.kernel.org, Olof Johansson , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 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=-4.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,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 From: Domenico Andreoli Proof of concept: ARM64 as a consumer of the machine reset hooks. Cc: Catalin Marinas Cc: Will Deacon Cc: linux-arch@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Domenico Andreoli --- arch/arm64/kernel/process.c | 5 +++++ kernel/power/Kconfig | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) Index: b/kernel/power/Kconfig =================================================================== --- a/kernel/power/Kconfig +++ b/kernel/power/Kconfig @@ -297,4 +297,4 @@ config CPU_PM config MACHINE_RESET bool default n - depends on ARM + depends on ARM || ARM64 Index: b/arch/arm64/kernel/process.c =================================================================== --- a/arch/arm64/kernel/process.c +++ b/arch/arm64/kernel/process.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -120,6 +121,8 @@ void machine_power_off(void) machine_shutdown(); if (pm_power_off) pm_power_off(); + else + default_power_off(); } void machine_restart(char *cmd) @@ -133,6 +136,8 @@ void machine_restart(char *cmd) /* Now call the architecture specific reboot code. */ if (arm_pm_restart) arm_pm_restart(reboot_mode, cmd); + else + default_restart(reboot_mode, cmd); /* * Whoops - the architecture was unable to reboot.