From patchwork Tue Mar 29 07:18:01 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 64569 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp1849951lbc; Tue, 29 Mar 2016 00:20:14 -0700 (PDT) X-Received: by 10.66.146.39 with SMTP id sz7mr1126906pab.76.1459236014741; Tue, 29 Mar 2016 00:20:14 -0700 (PDT) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id rd7si4467245pab.90.2016.03.29.00.20.14 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 29 Mar 2016 00:20:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org 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 1aknvf-0001Ix-5q; Tue, 29 Mar 2016 07:19:07 +0000 Received: from mail-wm0-x22d.google.com ([2a00:1450:400c:c09::22d]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aknvG-0000kW-FB for linux-arm-kernel@lists.infradead.org; Tue, 29 Mar 2016 07:18:43 +0000 Received: by mail-wm0-x22d.google.com with SMTP id p65so12583176wmp.0 for ; Tue, 29 Mar 2016 00:18:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Vqe+ofqhFh+hkC/RALahdVkg/gmxb4aKwcw5DmACEZk=; b=fBGCvFsfQDbnRIvbS9VrN0ARCpLz68d/mfBHnBx++Bm128Qx6eY6UAijFZMcdnxRD0 hFOhTfuTfq7Zl0CYY3g8/Fgunu5PjkXFToB7Bg9SjpxLpWzjyjpdbZ19Kj5E3NFPXRjv fAHEtQ2fvrvWLtxiLBuCkky9mKe8M9DX4EXGs= 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=Vqe+ofqhFh+hkC/RALahdVkg/gmxb4aKwcw5DmACEZk=; b=EKr8g1kWulfofMwNZ0yhNV5XlXMJQpGQg9jAU9odP83ceFxO5DLmiJl36KPQaDeoSe OK8MyV0uH0cIYV8mxeSSfg3vxvQt/xDT2KMo3IgMX/PIMYEUXNwFgGzyNuWs/m/k7MpR zFYqL0TC+AhMKeUb4hQupDeroXzxOGWQDcx4HIKBWbwMvIh6NCu2Ae4y0vF20eb0nFuG PtxJdnmc3mRqiFtA7l27PVcikb9KrT8zQE/h+drMvIfpApgUB5PiBrGG3lMWVdvXioHL uGZdlXJthxG5yDTuAtyhfO5sCBV9k3jTAOGNp4Jfdpo55KMSCI5awR7zGm1lZalmxMtQ i+eA== X-Gm-Message-State: AD7BkJJkN5gY1gL41CcoBi1o75uxwSWSqZtAqnmjy/7tVodisLw0PcxxoQuOz2uCXcVs5vHQ X-Received: by 10.28.87.139 with SMTP id l133mr1264374wmb.38.1459235900173; Tue, 29 Mar 2016 00:18:20 -0700 (PDT) Received: from localhost.localdomain ([195.55.142.58]) by smtp.gmail.com with ESMTPSA id av3sm27921427wjc.44.2016.03.29.00.18.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 29 Mar 2016 00:18:19 -0700 (PDT) From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org, linux@arm.linux.org.uk, linux+pull@arm.linux.org.uk Subject: [PULL 1/4] ARM: reintroduce ioremap_cached() for creating cached I/O mappings Date: Tue, 29 Mar 2016 09:18:01 +0200 Message-Id: <1459235884-24318-2-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1459235884-24318-1-git-send-email-ard.biesheuvel@linaro.org> References: <1459235884-24318-1-git-send-email-ard.biesheuvel@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160329_001842_748916_E57078E4 X-CRM114-Status: GOOD ( 10.85 ) X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2a00:1450:400c:c09:0:0:0:22d listed in] [list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: matt@codeblueprint.co.uk, Russell King , dan.j.williams@intel.com, Ard Biesheuvel MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org The original ARM-only ioremap flavor 'ioremap_cached' has been renamed to 'ioremap_cache' to align with other architectures, and subsequently abused in generic code to map things like firmware tables in memory. For that reason, there is currently an effort underway to deprecate ioremap_cache, whose semantics are poorly defined, and which is typed with an __iomem annotation that is inappropriate for mappings of ordinary memory. However, original users of ioremap_cached() used it in a context where the I/O connotation is appropriate, and replacing those instances with memremap() does not make sense. So let's revive ioremap_cached(), so that we can change back those original users before we drop ioremap_cache entirely in favor of memremap. Cc: Russell King Acked-by: Dan Williams Signed-off-by: Ard Biesheuvel --- arch/arm/include/asm/io.h | 6 ++++++ arch/arm/mm/ioremap.c | 4 ++++ 2 files changed, 10 insertions(+) -- 2.5.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel diff --git a/arch/arm/include/asm/io.h b/arch/arm/include/asm/io.h index 485982084fe9..fb94de290edd 100644 --- a/arch/arm/include/asm/io.h +++ b/arch/arm/include/asm/io.h @@ -395,6 +395,12 @@ void __iomem *ioremap(resource_size_t res_cookie, size_t size); void __iomem *ioremap_cache(resource_size_t res_cookie, size_t size); #define ioremap_cache ioremap_cache +/* + * Do not use ioremap_cached in new code. Provided for the benefit of + * the pxa2xx-flash MTD driver only. + */ +void __iomem *ioremap_cached(resource_size_t res_cookie, size_t size); + void __iomem *ioremap_wc(resource_size_t res_cookie, size_t size); #define ioremap_wc ioremap_wc #define ioremap_wt ioremap_wc diff --git a/arch/arm/mm/ioremap.c b/arch/arm/mm/ioremap.c index 66a978d05958..d5350f6af089 100644 --- a/arch/arm/mm/ioremap.c +++ b/arch/arm/mm/ioremap.c @@ -380,11 +380,15 @@ void __iomem *ioremap(resource_size_t res_cookie, size_t size) EXPORT_SYMBOL(ioremap); void __iomem *ioremap_cache(resource_size_t res_cookie, size_t size) + __alias(ioremap_cached); + +void __iomem *ioremap_cached(resource_size_t res_cookie, size_t size) { return arch_ioremap_caller(res_cookie, size, MT_DEVICE_CACHED, __builtin_return_address(0)); } EXPORT_SYMBOL(ioremap_cache); +EXPORT_SYMBOL(ioremap_cached); void __iomem *ioremap_wc(resource_size_t res_cookie, size_t size) {