From patchwork Tue Aug 5 01:48:54 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guenter Roeck X-Patchwork-Id: 4675111 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 D7FEA9F375 for ; Tue, 5 Aug 2014 01:52:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0A8C120166 for ; Tue, 5 Aug 2014 01:52:08 +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 3EE772015A for ; Tue, 5 Aug 2014 01:52:07 +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 1XETsj-0007lw-Gt; Tue, 05 Aug 2014 01:49:41 +0000 Received: from mail-pa0-x229.google.com ([2607:f8b0:400e:c03::229]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XETsa-0007f3-V1 for linux-arm-kernel@lists.infradead.org; Tue, 05 Aug 2014 01:49:33 +0000 Received: by mail-pa0-f41.google.com with SMTP id rd3so385442pab.0 for ; Mon, 04 Aug 2014 18:49:15 -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=MBVScnioLem2qr6S8EOcVMQPSnyfTWgScgPnT0mT4CQ=; b=CKdyHXzHWDwYhEr4+4eNpk7mYqeVm1yLRV6cOa93kv/dPmDp6JqGld/9skqp26foF9 qwWr//ZUuDzLCVtu0RkA4J2UpWOLE3UdxJ/c9GkvSaU0k/vJN3bE88vR5DLXvchOtuFU s2xGz359iqhveYw/cmNsNe3N7OAKyQ/CoNTTAlzoIrp27eJL5L9+/gvcRSK+CM60gKxT PdyyXMJpaUCjrEuFb5E0DTXgOvFlyfrv319/W27TX84xn7B8e3w0Rcuq7tgu39U3S2Ws leG82dZmAQbuzywxxot0xqpkrVAFX48TgSFyYi+X7N3WhghlGs/yeDSz+gQd74Fl4ob1 dvBg== X-Received: by 10.70.92.49 with SMTP id cj17mr533765pdb.53.1407203355145; Mon, 04 Aug 2014 18:49:15 -0700 (PDT) Received: from localhost (108-223-40-66.lightspeed.sntcca.sbcglobal.net. [108.223.40.66]) by mx.google.com with ESMTPSA id wp3sm167371pbc.67.2014.08.04.18.49.13 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 04 Aug 2014 18:49:14 -0700 (PDT) From: Guenter Roeck To: linux-watchdog@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v6 3/7] arm: Support restart through restart handler call chain Date: Mon, 4 Aug 2014 18:48:54 -0700 Message-Id: <1407203338-12915-4-git-send-email-linux@roeck-us.net> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1407203338-12915-1-git-send-email-linux@roeck-us.net> References: <1407203338-12915-1-git-send-email-linux@roeck-us.net> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140804_184933_053179_3EA8C56F X-CRM114-Status: GOOD ( 12.44 ) X-Spam-Score: -0.4 (/) Cc: Ingo Molnar , Russell King , Heiko Stuebner , Arnd Bergmann , linux-doc@vger.kernel.org, Dmitry Eremin-Solenikov , Catalin Marinas , Tomasz Figa , Randy Dunlap , Will Deacon , linux-kernel@vger.kernel.org, Steven Rostedt , Jonas Jensen , Wim Van Sebroeck , Maxime Ripard , David Woodhouse , Andrew Morton , Guenter Roeck 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, 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 restart handler call chain for system restart functions. With this change, the arm_pm_restart callback is now optional, so check if it is set before calling it. Only call the kernel restart handler if arm_pm_restart is not set. Signed-off-by: Guenter Roeck Acked-by: Catalin Marinas Acked-by: Heiko Stuebner --- v6: No change. v5: Renamed restart function to do_kernel_restart v4: No change. v3: Use wrapper function to execute notifier call chain. v2: Only call notifier call chain if arm_pm_restart is not set. Do not include linux/watchdog.h. arch/arm/kernel/process.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c index 81ef686..84ca0d5 100644 --- a/arch/arm/kernel/process.c +++ b/arch/arm/kernel/process.c @@ -230,7 +230,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 + do_kernel_restart(cmd); /* Give a grace period for failure to restart of 1s */ mdelay(1000);