From patchwork Thu May 15 20:38:22 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guenter Roeck X-Patchwork-Id: 4185841 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 7D3389F1C0 for ; Thu, 15 May 2014 20:42:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A29BA20398 for ; Thu, 15 May 2014 20:42:01 +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 CC43D20396 for ; Thu, 15 May 2014 20:42:00 +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 1Wl2RA-0002MV-7t; Thu, 15 May 2014 20:39:32 +0000 Received: from mail-pb0-x229.google.com ([2607:f8b0:400e:c01::229]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Wl2Qn-00025U-Vq for linux-arm-kernel@lists.infradead.org; Thu, 15 May 2014 20:39:10 +0000 Received: by mail-pb0-f41.google.com with SMTP id uo5so1573548pbc.28 for ; Thu, 15 May 2014 13:38:51 -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=ltP+6G4J1EgwLzPDPtOtQu0JzZWVSzYzz/8VHgChec8=; b=mZE6brXfScPWJaIHdoP+dtN1gC5lGXoUpB2bMXGtqrxhiETaX9YdNHQcWWj0Xu5Sp9 ukuhKWOXpfmyHJoI0onqg7LMRuV3EVJT5qxGSvHWhGDWRtlmu3FOZnTUmjNDpI0RWOQ3 rUf/2BvrKSdZadVsYB+5gkh72yMiB08hBjRffwfSUd9w+q5A2nGZcZOfylr+Km5jwryL nU9sK+nah2xRUqsVcxP73jqbrwvtMMCyzct9n6594Q4kv5hVFTB4LZFQxBvFxGfRIMYo THEAvMRUmrci9gO+8WYRN8sAeMIC/niqwPyur4PaDEc1Q8OwrNDF1ga4R9fnLyVfIHL7 RfYQ== X-Received: by 10.66.156.34 with SMTP id wb2mr15226898pab.83.1400186331220; Thu, 15 May 2014 13:38:51 -0700 (PDT) Received: from localhost (108-223-40-66.lightspeed.sntcca.sbcglobal.net. [108.223.40.66]) by mx.google.com with ESMTPSA id ih6sm10669457pbc.22.2014.05.15.13.38.49 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 15 May 2014 13:38:50 -0700 (PDT) From: Guenter Roeck To: linux-watchdog@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v3 4/6] arm: Support reboot through watchdog subsystem Date: Thu, 15 May 2014 13:38:22 -0700 Message-Id: <1400186304-1691-5-git-send-email-linux@roeck-us.net> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1400186304-1691-1-git-send-email-linux@roeck-us.net> References: <1400186304-1691-1-git-send-email-linux@roeck-us.net> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140515_133910_051028_69AED84E X-CRM114-Status: GOOD ( 10.49 ) X-Spam-Score: 0.2 (/) Cc: Russell King , Heiko Stuebner , Arnd Bergmann , linux-doc@vger.kernel.org, Catalin Marinas , Randy Dunlap , Will Deacon , linux-kernel@vger.kernel.org, Jonas Jensen , Wim Van Sebroeck , Maxime Ripard , Guenter Roeck 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=-2.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, 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 watchdog subsystem provides an API to perform a system reboot. Use it. With this change, the arm_pm_restart callback is now optional, so check if it is set before calling it. Tested-by: Jonas Jensen Signed-off-by: Guenter Roeck --- v3: Drop reboot mode and cmd string parameters from API v2: No change arch/arm/kernel/process.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c index 81ef686..4bfbedc 100644 --- a/arch/arm/kernel/process.c +++ b/arch/arm/kernel/process.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -230,7 +231,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); + + watchdog_do_reboot(); /* Give a grace period for failure to restart of 1s */ mdelay(1000);