From patchwork Thu Oct 31 06:27:10 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Domenico Andreoli X-Patchwork-Id: 3119301 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 6A0129F2B7 for ; Thu, 31 Oct 2013 07:05:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 90B1F203E6 for ; Thu, 31 Oct 2013 07:05:48 +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 7A3AF20177 for ; Thu, 31 Oct 2013 07:05:47 +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 1VbloK-0005mZ-1i; Thu, 31 Oct 2013 06:32:54 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VblnU-0008M6-2w; Thu, 31 Oct 2013 06:32:00 +0000 Received: from mail-ea0-f176.google.com ([209.85.215.176]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Vblm2-0008C2-3v for linux-arm-kernel@lists.infradead.org; Thu, 31 Oct 2013 06:30:41 +0000 Received: by mail-ea0-f176.google.com with SMTP id q16so1124771ead.21 for ; Wed, 30 Oct 2013 23:30:03 -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=Ej3q1sWBMCxlrVcDlMSL54VMUL3KD5F9XI0E8AFiR7c=; b=YBhtemyP3e9Le3tNLXvFWHjj9tAOdlBHU1eus9pNnT7MvQPIV17jYg4vBrwA45mJra ZK2P0F10huYIYINNYxSD1sd6IOBe2eIKH1iD4VqAoLf+H6LTgXtBNoYP4NCXgpTmCSW+ qrhh3FW/2rWatDmuz8P5c8uVVjQYkVGbKNnrNKljRRxKPMc/gnTVPLxWHnFW3yootFXf C3QkaKdgnTzZHOme/mhcIfuNSSsXlnI0TVxyfrEESl+9NncTBVUCy8WBMVymu0qF18/H 6222A5VCOPCpWlZovL3Kb/m3OM92pMGSMNir7x8MbELUFZT5dZ5nmbq3eZ0T8I3WGiWx ypKg== X-Received: by 10.14.193.198 with SMTP id k46mr313182een.128.1383201003919; Wed, 30 Oct 2013 23:30:03 -0700 (PDT) Received: from shock.dandreoli.com (j115181.upc-j.chello.nl. [24.132.115.181]) by mx.google.com with ESMTPSA id j7sm4370651eeo.15.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 CA431340266; Thu, 31 Oct 2013 07:29:58 +0100 (CET) Message-Id: <20131031062958.576361964@linux.com> User-Agent: quilt/0.60-1 Date: Thu, 31 Oct 2013 07:27:10 +0100 From: Domenico Andreoli To: linux-arch@vger.kernel.org Subject: [PATCH 02/11] ARM: use the common machine reset handling References: <20131031062708.520968323@linux.com> Content-Disposition: inline; filename=arm-machine-reset.patch X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131031_023030_363238_39B2FFCD X-CRM114-Status: GOOD ( 13.24 ) X-Spam-Score: -2.6 (--) Cc: Russell King , Arnd Bergmann , 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: ARM as a consumer of the machine reset hooks. Cc: Russell King Cc: Arnd Bergmann Cc: Olof Johansson Cc: Will Deacon Cc: linux-arch@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Domenico Andreoli --- arch/arm/kernel/process.c | 14 ++++++++------ kernel/power/Kconfig | 1 + 2 files changed, 9 insertions(+), 6 deletions(-) Index: b/arch/arm/kernel/process.c =================================================================== --- a/arch/arm/kernel/process.c +++ b/arch/arm/kernel/process.c @@ -33,6 +33,7 @@ #include #include #include +#include #include #include @@ -114,17 +115,13 @@ void soft_restart(unsigned long addr) BUG(); } -static void null_restart(enum reboot_mode reboot_mode, const char *cmd) -{ -} - /* * Function pointers to optional machine specific functions */ void (*pm_power_off)(void); EXPORT_SYMBOL(pm_power_off); -void (*arm_pm_restart)(enum reboot_mode reboot_mode, const char *cmd) = null_restart; +void (*arm_pm_restart)(enum reboot_mode reboot_mode, const char *cmd); EXPORT_SYMBOL_GPL(arm_pm_restart); /* @@ -217,6 +214,8 @@ void machine_power_off(void) if (pm_power_off) pm_power_off(); + else + default_power_off(); } /* @@ -235,7 +234,10 @@ void machine_restart(char *cmd) local_irq_disable(); smp_send_stop(); - arm_pm_restart(reboot_mode, cmd); + if (arm_pm_restart) + arm_pm_restart(reboot_mode, cmd); + else + default_restart(reboot_mode, cmd); /* Give a grace period for failure to restart of 1s */ mdelay(1000); Index: b/kernel/power/Kconfig =================================================================== --- a/kernel/power/Kconfig +++ b/kernel/power/Kconfig @@ -297,3 +297,4 @@ config CPU_PM config MACHINE_RESET bool default n + depends on ARM