From patchwork Wed Feb 5 17:03:52 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leif Lindholm X-Patchwork-Id: 24191 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f197.google.com (mail-ve0-f197.google.com [209.85.128.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A1CD420675 for ; Wed, 5 Feb 2014 17:05:19 +0000 (UTC) Received: by mail-ve0-f197.google.com with SMTP id oz11sf1420353veb.0 for ; Wed, 05 Feb 2014 09:05:18 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=0JGjDWaibJWLb6/OEOL/OXpPgQlcmOpQIRDqDEPQoIU=; b=FIzFGKV8k3hyU0brnGiSCVj7Zs6AF1daJmifcEAxBpcFqQ9UVnnWepJdC2kS5RYK6M CYpNlAsVenSoKQoPSja9uh2HJra+YkYyU7kCOEE2X9E2yynBJKHKNbqorPdf8xw5Z6Mj +MOtCc6lvWWydGljWGUBRvXdjaZIDvtLxpwqSHU6mkeR/bKkUMDKLUFdjdToL6BNH8L2 KDqCigd7bep5enZh083zNyCEngJqL5DEuU3BmXpgAg3OErI3eLxlMh/cfvjIFhvlPJC9 8rEs6kHNgsa0YwmqZxLKZLcs5rRCGw3YqExrVt9mxWd8hIwI524byYuqCHkJUBOxVz77 3jrw== X-Gm-Message-State: ALoCoQkLD5Mho7K/hvhOcw2UKqxYJHxtBURTic99gf1AJBStmmgJdISvP6pSr0F2UGKIvCOWznJZ X-Received: by 10.58.179.101 with SMTP id df5mr1053138vec.38.1391619918788; Wed, 05 Feb 2014 09:05:18 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.80.149 with SMTP id c21ls201042qgd.52.gmail; Wed, 05 Feb 2014 09:05:18 -0800 (PST) X-Received: by 10.52.30.167 with SMTP id t7mr1445893vdh.36.1391619918683; Wed, 05 Feb 2014 09:05:18 -0800 (PST) Received: from mail-ve0-f174.google.com (mail-ve0-f174.google.com [209.85.128.174]) by mx.google.com with ESMTPS id x16si9863306vct.105.2014.02.05.09.05.18 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 05 Feb 2014 09:05:18 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.174 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.174; Received: by mail-ve0-f174.google.com with SMTP id pa12so531672veb.19 for ; Wed, 05 Feb 2014 09:05:18 -0800 (PST) X-Received: by 10.52.185.196 with SMTP id fe4mr1433368vdc.27.1391619918395; Wed, 05 Feb 2014 09:05:18 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp64551vcz; Wed, 5 Feb 2014 09:05:12 -0800 (PST) X-Received: by 10.180.12.43 with SMTP id v11mr17491026wib.33.1391619911123; Wed, 05 Feb 2014 09:05:11 -0800 (PST) Received: from mail-we0-f177.google.com (mail-we0-f177.google.com [74.125.82.177]) by mx.google.com with ESMTPS id vg1si15469434wjc.43.2014.02.05.09.05.10 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 05 Feb 2014 09:05:11 -0800 (PST) Received-SPF: neutral (google.com: 74.125.82.177 is neither permitted nor denied by best guess record for domain of leif.lindholm@linaro.org) client-ip=74.125.82.177; Received: by mail-we0-f177.google.com with SMTP id t61so490152wes.8 for ; Wed, 05 Feb 2014 09:05:10 -0800 (PST) X-Received: by 10.194.8.229 with SMTP id u5mr386516wja.80.1391619910582; Wed, 05 Feb 2014 09:05:10 -0800 (PST) Received: from mohikan.mushroom.smurfnet.nu (cpc4-cmbg17-2-0-cust71.5-4.cable.virginm.net. [86.14.224.72]) by mx.google.com with ESMTPSA id p1sm47427211wie.1.2014.02.05.09.05.09 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Feb 2014 09:05:09 -0800 (PST) From: Leif Lindholm To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-efi@vger.kernel.org Cc: patches@linaro.org, Leif Lindholm Subject: [PATCH 01/22] arm: break part of __soft_restart out into separate function Date: Wed, 5 Feb 2014 17:03:52 +0000 Message-Id: <1391619853-10601-2-git-send-email-leif.lindholm@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1391619853-10601-1-git-send-email-leif.lindholm@linaro.org> References: <1391619853-10601-1-git-send-email-leif.lindholm@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: leif.lindholm@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.174 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Certain operations can be considered mandatory for any piece of code preparing to switch off the MMU. Break this out into separate function idmap_prepare(). Signed-off-by: Leif Lindholm Suggested-by: Will Deacon Acked-by: Will Deacon --- arch/arm/include/asm/idmap.h | 1 + arch/arm/kernel/process.c | 12 +----------- arch/arm/mm/idmap.c | 15 +++++++++++++++ 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/arch/arm/include/asm/idmap.h b/arch/arm/include/asm/idmap.h index bf863ed..2e914a8 100644 --- a/arch/arm/include/asm/idmap.h +++ b/arch/arm/include/asm/idmap.h @@ -10,5 +10,6 @@ extern pgd_t *idmap_pgd; void setup_mm_for_reboot(void); +void idmap_prepare(void); #endif /* __ASM_IDMAP_H */ diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c index 92f7b15..91b4cec 100644 --- a/arch/arm/kernel/process.c +++ b/arch/arm/kernel/process.c @@ -75,17 +75,7 @@ static void __soft_restart(void *addr) { phys_reset_t phys_reset; - /* Take out a flat memory mapping. */ - setup_mm_for_reboot(); - - /* Clean and invalidate caches */ - flush_cache_all(); - - /* Turn off caching */ - cpu_proc_fin(); - - /* Push out any further dirty data, and ensure cache is empty */ - flush_cache_all(); + idmap_prepare(); /* Switch to the identity mapping. */ phys_reset = (phys_reset_t)(unsigned long)virt_to_phys(cpu_reset); diff --git a/arch/arm/mm/idmap.c b/arch/arm/mm/idmap.c index 8e0e52e..5c85779 100644 --- a/arch/arm/mm/idmap.c +++ b/arch/arm/mm/idmap.c @@ -122,3 +122,18 @@ void setup_mm_for_reboot(void) local_flush_tlb_all(); #endif } + +void idmap_prepare(void) +{ + /* Take out a flat memory mapping. */ + setup_mm_for_reboot(); + + /* Clean and invalidate caches */ + flush_cache_all(); + + /* Turn off caching */ + cpu_proc_fin(); + + /* Push out any further dirty data, and ensure cache is empty */ + flush_cache_all(); +}