From patchwork Fri Oct 9 22:16:04 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Williams X-Patchwork-Id: 7364611 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 AF9E19F36A for ; Fri, 9 Oct 2015 22:24:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DDD4420760 for ; Fri, 9 Oct 2015 22:24:08 +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 F153620762 for ; Fri, 9 Oct 2015 22:24:07 +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 1Zkg3j-0001gn-HJ; Fri, 09 Oct 2015 22:22:39 +0000 Received: from mga14.intel.com ([192.55.52.115]) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Zkg3C-0000z1-2m for linux-arm-kernel@lists.infradead.org; Fri, 09 Oct 2015 22:22:07 +0000 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga103.fm.intel.com with ESMTP; 09 Oct 2015 15:21:46 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,660,1437462000"; d="scan'208";a="823302750" Received: from dwillia2-desk3.jf.intel.com ([10.54.39.39]) by orsmga002.jf.intel.com with ESMTP; 09 Oct 2015 15:21:46 -0700 Subject: [PATCH 05/20] m68k: introduce arch_memremap() From: Dan Williams To: linux-kernel@vger.kernel.org Date: Fri, 09 Oct 2015 18:16:04 -0400 Message-ID: <20151009221604.32203.58114.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_152206_214404_AFDF2C57 X-CRM114-Status: GOOD ( 12.92 ) 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 , Geert Uytterhoeven , 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_wt() introduce arch_memremap() for m68k. This simply enforces that attempts to establish writethrough mappings fail rather than silently fall back to uncached. Cc: Arnd Bergmann Cc: Ross Zwisler Cc: Geert Uytterhoeven Signed-off-by: Dan Williams --- arch/m68k/Kconfig | 1 + arch/m68k/mm/kmap.c | 17 ++++++++++++++++- arch/m68k/mm/sun3kmap.c | 7 +++++++ 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/arch/m68k/Kconfig b/arch/m68k/Kconfig index 498b567f007b..468b9ea6d042 100644 --- a/arch/m68k/Kconfig +++ b/arch/m68k/Kconfig @@ -9,6 +9,7 @@ config M68K select GENERIC_ATOMIC64 select HAVE_UID16 select VIRT_TO_BUS + select ARCH_HAS_MEMREMAP select ARCH_HAVE_NMI_SAFE_CMPXCHG if RMW_INSNS select GENERIC_CPU_DEVICES select GENERIC_IOMAP diff --git a/arch/m68k/mm/kmap.c b/arch/m68k/mm/kmap.c index 6e4955bc542b..519c45865127 100644 --- a/arch/m68k/mm/kmap.c +++ b/arch/m68k/mm/kmap.c @@ -14,12 +14,12 @@ #include #include #include +#include #include #include #include #include -#include #undef DEBUG @@ -223,6 +223,21 @@ void __iomem *__ioremap(unsigned long physaddr, unsigned long size, int cachefla } EXPORT_SYMBOL(__ioremap); +void *arch_memremap(resource_size_t offset, size_t size, unsigned long flags) +{ + int mode; + + if (flags & MEMREMAP_WB) + mode = IOMAP_FULL_CACHING; + else if (flags & MEMREMAP_WT) + mode = IOMAP_WRITETHROUGH; + else + return NULL; + + return (void __force *) __ioremap(offset, size, mode); +} +EXPORT_SYMBOL(arch_memremap); + /* * Unmap an ioremap()ed region again */ diff --git a/arch/m68k/mm/sun3kmap.c b/arch/m68k/mm/sun3kmap.c index 3dc41158c05e..981a9e423b23 100644 --- a/arch/m68k/mm/sun3kmap.c +++ b/arch/m68k/mm/sun3kmap.c @@ -116,6 +116,13 @@ void __iomem *__ioremap(unsigned long phys, unsigned long size, int cache) } EXPORT_SYMBOL(__ioremap); +void *arch_memremap(resource_size_t offset, size_t size, unsigned long flags) +{ + pr_err_once("sun3: no support for memremap\n"); + return NULL; +} +EXPORT_SYMBOL(arch_memremap); + void iounmap(void __iomem *addr) { vfree((void *)(PAGE_MASK & (unsigned long)addr));