From patchwork Mon Jun 30 19:11:36 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guenter Roeck X-Patchwork-Id: 4453991 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 D8762BEEAA for ; Mon, 30 Jun 2014 19:15:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 18BB12037E for ; Mon, 30 Jun 2014 19:15:41 +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 4F8252037D for ; Mon, 30 Jun 2014 19:15:40 +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 1X1h0u-0005fI-Nk; Mon, 30 Jun 2014 19:13:16 +0000 Received: from mail-pd0-x231.google.com ([2607:f8b0:400e:c02::231]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1X1gzy-0004uU-45 for linux-arm-kernel@lists.infradead.org; Mon, 30 Jun 2014 19:12:18 +0000 Received: by mail-pd0-f177.google.com with SMTP id y10so8700213pdj.36 for ; Mon, 30 Jun 2014 12:11:56 -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=bKn1W6Hen+eXkyeVTeXk+FZeb+ZHy930R3kNqZi5fVA=; b=IbW84p9v8zYe46AvFRELvM/mWoVD86swsZEPLummjFB3F1sySZglJaW2cYx1r/p94f 3hF+PJSv+2OXZbt+cp0a00MEkfE1BVe2sAOzMtDNgqtRJryoilf3nBm9hgsYYbQAAUFm CiX0sORaBCgb/7JwNSSiByMkoy3Dzt3I0hUsPkSdGMB+M5fm/DwBOWrUJ4n+VqF0xLT9 QEioPwN/Ylo8IvDOXPFHdzLD653oCZrbbwsF/JS4SCRYN3dvtXOTc/ofD9klG7gL8BNY tOjUuv4Kbi844K+iFz3vWSKIEGL5L9qf42Hrbnpxun7/Tk5v3VEONExylDiE8/JCyVJd cayw== X-Received: by 10.66.139.73 with SMTP id qw9mr54593730pab.123.1404155516387; Mon, 30 Jun 2014 12:11:56 -0700 (PDT) Received: from localhost (108-223-40-66.lightspeed.sntcca.sbcglobal.net. [108.223.40.66]) by mx.google.com with ESMTPSA id kq10sm28990163pbc.90.2014.06.30.12.11.54 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 30 Jun 2014 12:11:55 -0700 (PDT) From: Guenter Roeck To: linux-watchdog@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [RFC PATCH 3/6] arm: Support restart through restart notifier call chain Date: Mon, 30 Jun 2014 12:11:36 -0700 Message-Id: <1404155499-21177-4-git-send-email-linux@roeck-us.net> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1404155499-21177-1-git-send-email-linux@roeck-us.net> References: <1404155499-21177-1-git-send-email-linux@roeck-us.net> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140630_121218_252204_9BE19E0F X-CRM114-Status: GOOD ( 11.56 ) X-Spam-Score: -0.4 (/) Cc: Ingo Molnar , Russell King , Heiko Stuebner , Arnd Bergmann , linux-doc@vger.kernel.org, Catalin Marinas , Randy Dunlap , Will Deacon , linux-kernel@vger.kernel.org, Steven Rostedt , Jonas Jensen , Wim Van Sebroeck , Maxime Ripard , 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=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=no 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 notifier 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. Signed-off-by: Guenter Roeck --- 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..93765f2 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); + + blocking_notifier_call_chain(&restart_notifier_list, reboot_mode, cmd); /* Give a grace period for failure to restart of 1s */ mdelay(1000);