From patchwork Thu Mar 31 09:18:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 64751 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp49844lbc; Thu, 31 Mar 2016 02:41:35 -0700 (PDT) X-Received: by 10.98.44.73 with SMTP id s70mr20618158pfs.2.1459417294857; Thu, 31 Mar 2016 02:41:34 -0700 (PDT) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id y19si13034847pfa.62.2016.03.31.02.41.33 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 31 Mar 2016 02:41:34 -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; dmarc=fail (p=NONE dis=NONE) header.from=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 1alZ57-00016v-Ad; Thu, 31 Mar 2016 09:40:01 +0000 Received: from merlin.infradead.org ([2001:4978:20e::2]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1alZ4P-0000bJ-OC for linux-arm-kernel@bombadil.infradead.org; Thu, 31 Mar 2016 09:39:17 +0000 Received: from mail-wm0-x229.google.com ([2a00:1450:400c:c09::229]) by merlin.infradead.org with esmtps (Exim 4.85 #2 (Red Hat Linux)) id 1alYlF-0003cI-EP for linux-arm-kernel@lists.infradead.org; Thu, 31 Mar 2016 09:19:30 +0000 Received: by mail-wm0-x229.google.com with SMTP id r72so132411965wmg.0 for ; Thu, 31 Mar 2016 02:19:09 -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=VOTH7EI1MscKuNR4MsReMkkpSIrI4iXi5Purh/gPKOLW+5eggLh4kO7pT5kph0Y6wD 0GkULNcoE2L4wcL+LjeGZ6Zu2lLX4xWkuOgpJxe1kuDtLLhA1ZCwQOhPLJU6ohyGUWdS r8rajfM0oe41hC0dEhwNMJaNP+qw19ZmDxqlE= 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=E5aFvbnIRJ64L/ulZIzPUmcEnkObsyGVbHtyacNtU9As/SmycdPJYkD7nevPwwetzg o/GqPiOemeMQ/nIp4LtloesOPJF/xBP2hsYqN8y9JZlOX2aQkDTl7qnGh85aRxPvuQOl X1dFwR30y1XABRKEGR21Bya/SJjhZtzzDS9xA3J9rZz4JniV+uQPpKUen6Zu+ZwQ96h4 FyWng43GZ3YZ6nJ56KCBfVJ2GEetQCPy6KSp2QgbgUYebHqwg89mf06BtB9UNQugVTRc jrdN5e0Sw2VToP2uAsFzr6C7Mco7x5EXc6CLIueGKdfx30ehJKjDeIPY/icAerQt7e0W EbuQ== X-Gm-Message-State: AD7BkJJT9mLz7qp804C8PjVexKjGFlnKKguywH7g5tIG1p9oPNk6fcdC4rf6+/xOYhmqtOgP X-Received: by 10.194.236.198 with SMTP id uw6mr2062078wjc.42.1459415947378; Thu, 31 Mar 2016 02:19:07 -0700 (PDT) Received: from localhost.localdomain ([195.55.142.58]) by smtp.gmail.com with ESMTPSA id k125sm23742060wmb.14.2016.03.31.02.19.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 31 Mar 2016 02:19:06 -0700 (PDT) From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org, linux@arm.linux.org.uk Subject: [PATCH v4 1/4] ARM: reintroduce ioremap_cached() for creating cached I/O mappings Date: Thu, 31 Mar 2016 11:18:49 +0200 Message-Id: <1459415932-17852-2-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1459415932-17852-1-git-send-email-ard.biesheuvel@linaro.org> References: <1459415932-17852-1-git-send-email-ard.biesheuvel@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160331_051929_720537_C275224E X-CRM114-Status: GOOD ( 11.13 ) X-Spam-Score: -2.0 (--) X-Spam-Report: SpamAssassin version 3.4.1 on merlin.infradead.org summary: Content analysis details: (-2.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -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_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) {