From patchwork Wed Feb 19 01:52:07 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Capella X-Patchwork-Id: 3677591 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 A79E1BF13A for ; Wed, 19 Feb 2014 01:53:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BE16020171 for ; Wed, 19 Feb 2014 01:53:28 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (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 C46CD20145 for ; Wed, 19 Feb 2014 01:53:27 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WFwLO-000746-6f; Wed, 19 Feb 2014 01:53:02 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WFwLI-0008Lt-CF; Wed, 19 Feb 2014 01:52:56 +0000 Received: from mail-pb0-f52.google.com ([209.85.160.52]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WFwL1-0008Hi-Sg for linux-arm-kernel@lists.infradead.org; Wed, 19 Feb 2014 01:52:40 +0000 Received: by mail-pb0-f52.google.com with SMTP id jt11so17623198pbb.11 for ; Tue, 18 Feb 2014 17:52:17 -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=CawAkaFOCwP67dPtTNRhO6K905VtZaTqBZl0JjVABbM=; b=hVgP8Dbf9mXsy6G+TVuPjSH/r99+ODiLumnvomMxeyXJ4u0K94IwrwYg6qC+SeTlXi P5L0bZrKlLV5r1NggL+wp46wFu0/sdN1JMWwr5g9Fz5gghgqgRjELKoWqmM0buvJ6RPF /4gSSD108yt1a7TiKgmfH08WgFcopBlSUi7BTcJYtgfZW5HhvnmQxuqwGvmM8F8BUMv8 knyLQ3qAaIz6BweLoksygIyc5hkuFBY/Eyl2rt+QaL/5oeZFo1f9yoZFLDz93QuTgwWR AoZxmLN4Tggsph1rbGshiSbYdv6TlaySD42mFfLzEByTbZRB/W6pgVW5+5zEC9MJ9n7y NuEg== X-Gm-Message-State: ALoCoQnzDk/EQFbpQ3YAPn/6tW+zE2IoH4qzVti3PTXxJKH/ZZAtwfHMY4mBQlHAS7dwssJ/hrdH X-Received: by 10.68.231.35 with SMTP id td3mr18522425pbc.137.1392774737479; Tue, 18 Feb 2014 17:52:17 -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 qh2sm154335030pab.13.2014.02.18.17.52.14 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 18 Feb 2014 17:52:16 -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 Subject: [PATCH RFC v1 1/3] ARM: Add irq disabled version of soft_restart. Date: Tue, 18 Feb 2014 17:52:07 -0800 Message-Id: <1392774729-3235-2-git-send-email-sebastian.capella@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1392774729-3235-1-git-send-email-sebastian.capella@linaro.org> References: <1392774729-3235-1-git-send-email-sebastian.capella@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140218_205240_036549_F3B06E87 X-CRM114-Status: GOOD ( 13.63 ) X-Spam-Score: 0.3 (/) Cc: Russell King , Will Deacon , Russ Dill , Sebastian Capella , Andrew Morton , Thomas Gleixner , Robin Holt 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=-1.9 required=5.0 tests=BAYES_00,KHOP_BIG_TO_CC, RCVD_IN_DNSWL_MED, 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) { }