From patchwork Fri Mar 4 09:48:45 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 63558 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp365166lbc; Fri, 4 Mar 2016 01:50:22 -0800 (PST) X-Received: by 10.66.164.39 with SMTP id yn7mr10546582pab.107.1457085022345; Fri, 04 Mar 2016 01:50:22 -0800 (PST) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id k81si4776636pfj.154.2016.03.04.01.50.22 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 Mar 2016 01:50:22 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-mtd-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; spf=pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-mtd-bounces+patch=linaro.org@lists.infradead.org; dkim=neutral (body hash did not verify) header.i=@linaro.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 1abmND-0002h4-9M; Fri, 04 Mar 2016 09:50:15 +0000 Received: from mail-wm0-x234.google.com ([2a00:1450:400c:c09::234]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1abmMI-0001ZW-6i for linux-mtd@lists.infradead.org; Fri, 04 Mar 2016 09:49:20 +0000 Received: by mail-wm0-x234.google.com with SMTP id l68so22439496wml.1 for ; Fri, 04 Mar 2016 01:48:57 -0800 (PST) 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=IJI7IoPN+jMPSlBdoTFAh26+MmJ0JDjzJx1FPok+OqU=; b=fWZstyqOp9Mmelw6rbG4G/Q23735J6k0X0QffL/RJk46/Ywd/A80gzaSz3DEAroOQY XicL8v0rmx0awH2yvklwm8QQ+biMQXeaGx4aSUftwhCVsn2kh8FB2WB1dLHltu5Afets Da07zoODsTLnK2AJtedqNUeq2/HoT2t16eT4I= 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=IJI7IoPN+jMPSlBdoTFAh26+MmJ0JDjzJx1FPok+OqU=; b=C2eBC/dhvzumkW5Xlo6n0xpkme6HzeEXimAvYLATe6N8k+2jrREG++LASzxM/f6LmY Shi+9/CCtERYee5tZj1maFPKwHONwJ8qAbIdx5zzGsJyva94Pqkj2l9rtBXimNxlocZV SnkPTAcVKcYAnff2cc1DrKMyL2aEaIekBpHQO6jzsIT8eVg8NHTbj/Ew2lgDilJyqxPC Z/0NpCcCJ056zx7ny/HFM7akNtXpSpsu/ss0kubVYTxpepjUR1yuAxL1XXzu8jkj4XC7 1fMJ5j0Or4DuII+N2Dd2xdi/wspvgQI9+TV7wz8UTDvRqZmvSR8B6WcO2QgPXGBWlVpD x40g== X-Gm-Message-State: AD7BkJJ6DIzBoKlA6fad6dscmBSlfx0JkExMZR3GGLE/u5QBmPWD1g14me5pBu6LbzVdQVqQ X-Received: by 10.28.90.68 with SMTP id o65mr3881618wmb.70.1457084936699; Fri, 04 Mar 2016 01:48:56 -0800 (PST) Received: from localhost.localdomain ([195.55.142.58]) by smtp.gmail.com with ESMTPSA id s206sm2426533wmf.23.2016.03.04.01.48.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 04 Mar 2016 01:48:55 -0800 (PST) From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org, linux-mtd@lists.infradead.org, linux@arm.linux.org.uk, dan.j.williams@intel.com Subject: [PATCH v3 1/4] ARM: reintroduce ioremap_cached() for creating cached I/O mappings Date: Fri, 4 Mar 2016 10:48:45 +0100 Message-Id: <1457084928-21179-2-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1457084928-21179-1-git-send-email-ard.biesheuvel@linaro.org> References: <1457084928-21179-1-git-send-email-ard.biesheuvel@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160304_014918_501421_815A50DC X-CRM114-Status: UNSURE ( 9.48 ) X-CRM114-Notice: Please train this message. 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.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2a00:1450:400c:c09:0:0:0:234 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 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 X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: robert.jarzmik@free.fr, computersforpeace@gmail.com, dwmw2@infradead.org, Russell King , Ard Biesheuvel MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-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 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 MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/ 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) {