From patchwork Sat May 10 00:31:21 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guenter Roeck X-Patchwork-Id: 4145811 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 4EA1BBFF02 for ; Sat, 10 May 2014 00:35:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7B5FD201DE for ; Sat, 10 May 2014 00:35:32 +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 7F762201BB for ; Sat, 10 May 2014 00:35:31 +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 1WivD6-000724-H4; Sat, 10 May 2014 00:32:16 +0000 Received: from mail-pa0-x232.google.com ([2607:f8b0:400e:c03::232]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WivCv-0006xh-7q for linux-arm-kernel@lists.infradead.org; Sat, 10 May 2014 00:32:05 +0000 Received: by mail-pa0-f50.google.com with SMTP id fb1so5042502pad.9 for ; Fri, 09 May 2014 17:31:44 -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=LAPyra7miI5zMyuIkXIKG6bZipgn+evJLRjO5lpoU+I=; b=Ds6mQiHRtRXnJZ2xUKCTP654UQk9a6B/LTv0Li7v7i0lC7eo72lDj8/Nz1C3uOn4y9 mlSsH5WhP46qvb5iaQxjrpbmDn7ovbD9CL1/RjnFrg414plCog5rVQFym++/ZhHhpfXJ PGX7uDkmplZqw/ARb4ywzvzAQ1vMFCWEWnjSsaMkbubvf9a1ZIN0QN2+Uh0eEIlPZZE2 toWSR8QnMKWh5fryRurpgkdGFAu3LOcA0ChsTb8CFBYjAZPy6zmDzOu7y4NxlCdADVQS zSP4UWhD5Z24Vl1RtQ2KEw+gYQ78mWtVzx4e7K1HnZ3VUyEeuO4b3SLovdOkFfdrnjhz Nw9g== X-Received: by 10.66.177.168 with SMTP id cr8mr26353479pac.128.1399681904257; Fri, 09 May 2014 17:31:44 -0700 (PDT) Received: from localhost (108-223-40-66.lightspeed.sntcca.sbcglobal.net. [108.223.40.66]) by mx.google.com with ESMTPSA id yj6sm14271776pab.19.2014.05.09.17.31.42 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 09 May 2014 17:31:43 -0700 (PDT) From: Guenter Roeck To: linux-watchdog@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 3/5] arm: Support reboot through watchdog subsystem Date: Fri, 9 May 2014 17:31:21 -0700 Message-Id: <1399681883-891-4-git-send-email-linux@roeck-us.net> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1399681883-891-1-git-send-email-linux@roeck-us.net> References: <1399681883-891-1-git-send-email-linux@roeck-us.net> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140509_173205_299752_DECF9186 X-CRM114-Status: GOOD ( 10.88 ) X-Spam-Score: 0.2 (/) Cc: Russell King , Heiko Stuebner , Arnd Bergmann , Catalin Marinas , 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 --- 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..c3b7b5e 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(reboot_mode, cmd); /* Give a grace period for failure to restart of 1s */ mdelay(1000);