From patchwork Tue Feb 25 00:27:37 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Capella X-Patchwork-Id: 3712331 Return-Path: X-Original-To: patchwork-linux-pm@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 ABD169F2F7 for ; Tue, 25 Feb 2014 00:28:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C480B20154 for ; Tue, 25 Feb 2014 00:28:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CA4FF20163 for ; Tue, 25 Feb 2014 00:28:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752954AbaBYA2J (ORCPT ); Mon, 24 Feb 2014 19:28:09 -0500 Received: from mail-pa0-f43.google.com ([209.85.220.43]:50056 "EHLO mail-pa0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752879AbaBYA1u (ORCPT ); Mon, 24 Feb 2014 19:27:50 -0500 Received: by mail-pa0-f43.google.com with SMTP id rd3so7275487pab.16 for ; Mon, 24 Feb 2014 16:27:50 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Vht60dsnRPVwqcXZgAY0vM+1J50kPIwUU0uMmuqifrw=; b=CxhFppNdKjKl418Adb7k2Ma2KU+V3CFz44a8WCqec4SJkmrNE2e9o5SGxqDcDQAl13 QiVEGwTkgGJ7ONqPBDG6HHpMfimc1tqL/Lr7tikzPq/6YjsWv541S6fOipCe/SZAWC6W V+35e3VzdGE37ix4Vl/669YSXfLmXq91HCASo3ER2fY+wMzBRqcBYxbfVUEqEqTxM1v3 qqqCtFZrgLp7FpQ1Y8Bc+EzbydxEP2VPJYOrUFoZz8j+awqKp0unkUKG7YcmdwX6jQJz XyMKxdl1nd0uey3NGKvcg1FXlxbxyszADbgiq1kUpaK7u71rvJ0FUWiK26eMcNu5+75y nCKw== X-Gm-Message-State: ALoCoQm0ZN80btc00kFYvTBwB3v9iQcOYCJTTUveVaAzpBNi1dP7TN3hj9vb9wO9aY52MbOIqaWc X-Received: by 10.66.121.131 with SMTP id lk3mr28163787pab.61.1393288070143; Mon, 24 Feb 2014 16:27:50 -0800 (PST) Received: from localhost (cpe-76-93-135-111.san.res.rr.com. [76.93.135.111]) by mx.google.com with ESMTPSA id bc4sm4093096pbb.2.2014.02.24.16.27.48 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 24 Feb 2014 16:27:49 -0800 (PST) From: Sebastian Capella To: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, linaro-kernel@lists.linaro.org, linux-arm-kernel@lists.infradead.org Cc: Russ Dill , Sebastian Capella , Russell King , Andrew Morton , Thomas Gleixner , Will Deacon , Robin Holt Subject: [PATCH v2 1/3] ARM: Add irq disabled version of soft_restart. Date: Mon, 24 Feb 2014 16:27:37 -0800 Message-Id: <1393288059-18174-2-git-send-email-sebastian.capella@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1393288059-18174-1-git-send-email-sebastian.capella@linaro.org> References: <1393288059-18174-1-git-send-email-sebastian.capella@linaro.org> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-3.8 required=5.0 tests=BAYES_00,KHOP_BIG_TO_CC, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, 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: Russ Dill This adds the ability to run soft_restart with local_irq/fiq_disable already called. This is helpful for the hibernation code paths. Signed-off-by: Russ Dill Signed-off-by: Sebastian Capella Cc: Russell King Cc: Andrew Morton Cc: Thomas Gleixner Cc: Will Deacon Cc: Robin Holt --- arch/arm/include/asm/system_misc.h | 1 + arch/arm/kernel/process.c | 15 ++++++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/arch/arm/include/asm/system_misc.h b/arch/arm/include/asm/system_misc.h index a3d61ad..eca8dd4 100644 --- a/arch/arm/include/asm/system_misc.h +++ b/arch/arm/include/asm/system_misc.h @@ -10,6 +10,7 @@ extern void cpu_init(void); +void soft_restart_noirq(unsigned long); void soft_restart(unsigned long); extern void (*arm_pm_restart)(enum reboot_mode reboot_mode, const char *cmd); extern void (*arm_pm_idle)(void); diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c index 92f7b15..685bc4a 100644 --- a/arch/arm/kernel/process.c +++ b/arch/arm/kernel/process.c @@ -95,14 +95,10 @@ static void __soft_restart(void *addr) BUG(); } -void soft_restart(unsigned long addr) +void soft_restart_noirq(unsigned long addr) { u64 *stack = soft_restart_stack + ARRAY_SIZE(soft_restart_stack); - /* Disable interrupts first */ - local_irq_disable(); - local_fiq_disable(); - /* Disable the L2 if we're the last man standing. */ if (num_online_cpus() == 1) outer_disable(); @@ -114,6 +110,15 @@ void soft_restart(unsigned long addr) BUG(); } +void soft_restart(unsigned long addr) +{ + /* Disable interrupts first */ + local_irq_disable(); + local_fiq_disable(); + + soft_restart_noirq(addr); +} + static void null_restart(enum reboot_mode reboot_mode, const char *cmd) { }