From patchwork Fri Oct 9 22:15:59 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Williams X-Patchwork-Id: 7364591 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 5FCFF9F443 for ; Fri, 9 Oct 2015 22:23:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 85BC120857 for ; Fri, 9 Oct 2015 22:23:54 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AB19220764 for ; Fri, 9 Oct 2015 22:23:53 +0000 (UTC) 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 1Zkg3X-0001VR-1x; Fri, 09 Oct 2015 22:22:27 +0000 Received: from mga11.intel.com ([192.55.52.93]) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Zkg37-0000yY-Pv for linux-arm-kernel@lists.infradead.org; Fri, 09 Oct 2015 22:22:02 +0000 Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga102.fm.intel.com with ESMTP; 09 Oct 2015 15:21:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,660,1437462000"; d="scan'208";a="661350239" Received: from dwillia2-desk3.jf.intel.com ([10.54.39.39]) by orsmga003.jf.intel.com with ESMTP; 09 Oct 2015 15:21:41 -0700 Subject: [PATCH 04/20] sh: introduce arch_memremap() From: Dan Williams To: linux-kernel@vger.kernel.org Date: Fri, 09 Oct 2015 18:15:59 -0400 Message-ID: <20151009221559.32203.37854.stgit@dwillia2-desk3.jf.intel.com> In-Reply-To: <20151009221537.32203.5867.stgit@dwillia2-desk3.jf.intel.com> References: <20151009221537.32203.5867.stgit@dwillia2-desk3.jf.intel.com> User-Agent: StGit/0.17.1-9-g687f MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151009_152201_878877_F5C67009 X-CRM114-Status: UNSURE ( 9.16 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -6.9 (------) 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: linux-arch@vger.kernel.org, Ross Zwisler , Arnd Bergmann , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_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 In preparation for removing ioremap_cache() introduce arch_memremap() for sh. This simply enforces that attempts to establish writethrough mappings fail rather than silently fallback to uncached. Cc: Arnd Bergmann Cc: Ross Zwisler Signed-off-by: Dan Williams --- arch/sh/Kconfig | 1 + arch/sh/mm/ioremap.c | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig index d514df7e04dd..b5801ae0e952 100644 --- a/arch/sh/Kconfig +++ b/arch/sh/Kconfig @@ -54,6 +54,7 @@ config SUPERH32 def_bool ARCH = "sh" select HAVE_KPROBES select HAVE_KRETPROBES + select ARCH_HAS_MEMREMAP select HAVE_IOREMAP_PROT if MMU && !X2TLB select HAVE_FUNCTION_TRACER select HAVE_FTRACE_MCOUNT_RECORD diff --git a/arch/sh/mm/ioremap.c b/arch/sh/mm/ioremap.c index 0c99ec2e7ed8..ce3819273368 100644 --- a/arch/sh/mm/ioremap.c +++ b/arch/sh/mm/ioremap.c @@ -86,6 +86,15 @@ __ioremap_caller(phys_addr_t phys_addr, unsigned long size, } EXPORT_SYMBOL(__ioremap_caller); +void *arch_memremap(resource_size_t offset, size_t size, unsigned long flags) +{ + if ((flags & MEMREMAP_WB) == 0) + return NULL; + + return (void __force *) __ioremap_mode(offset, size, PAGE_KERNEL); +} +EXPORT_SYMBOL(arch_memremap); + /* * Simple checks for non-translatable mappings. */