Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp304082ybl; Sat, 17 Aug 2019 00:52:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqyfuir57zg/4mnTdrPBi8eW4U7kfyixSvFvsxIUH6wX0TcVEgk7kWfYm1YqXbkd3JEr94Y0 X-Received: by 2002:a62:d0:: with SMTP id 199mr14562860pfa.157.1566028343341; Sat, 17 Aug 2019 00:52:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566028343; cv=none; d=google.com; s=arc-20160816; b=0W0h6S6Pqnp5gdrzyIMfwyJKNR6VOoZ/Ir/djEAeAIKwEmT4vGhNf6aY3dRCAI6WaN cn9D3fsuSTex+3YvrV0PpXuxx1j/dJ705MEh3NQvPr050HQhqSOsDZQSM4o4+d+vhc1b FaKbZO0Uro4bRH4TfNFymeAzLayNKcSZCB5w27VQq0i8BMS3Z4f3OAVtCdsLMkRepTFx e0Mv62Ab1r+M8W5yVlQz2hAeR/aR3bEXAqMcZhDJ5Ic+OcsqXdyaq/ZG6cgWBHRSycci 1hlzcDQnuJR75G97IJDMb/LrzFqL7ZIJUELByGY1keKy4zVQkYmo3rZmM1b2uO1aU4sL /UvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=H/LEmNPB4LUKmzKwKTw7HppJqT8OudhcMVRJaPxcfXo=; b=CsOv2luCesYABqzYKMmU0oEzoysx0IakBlaTTFFLP3n0Bk1EJtTVeek7hbeh56ulrh Vv6wp7HrtLT0VY3mX8FIg3BSTXy7ZB6zI3grlo32F3B7mnn8qDIPL5ijF3r/W8X93muw Q1VVXOwMuEmf92twOWr/0LObPJkZObGQlgekJwqcTnpbpUja8qagYlSAQpjjMILbkGBK dsl+b2X/2935o2iGIY5PW7OOSOw42DUWwv4A58hVQsKJS/+wVHSeRoZGCnwsE7b78SCQ B2zIKMXrnACUPdJ2vh/N+i365LH5fHZV/BrDpuRR9s3hfY1lIut6G6CQXqQQVJ7NKQvv O9zg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=pzk8LMAI; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h69si5398129pge.543.2019.08.17.00.52.09; Sat, 17 Aug 2019 00:52:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=pzk8LMAI; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726457AbfHQHuC (ORCPT + 99 others); Sat, 17 Aug 2019 03:50:02 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:37078 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726386AbfHQHtC (ORCPT ); Sat, 17 Aug 2019 03:49:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From :Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=H/LEmNPB4LUKmzKwKTw7HppJqT8OudhcMVRJaPxcfXo=; b=pzk8LMAIE1YeLLSo3cuHtk2GR4 Y0uanGBXiTDJ2QkwfZe4gwaPUdwva0NK+NTSezuHwF5xymwcbjauYY+MSqS2bAlhvQHI3IPD3aMDp wApGRa1T14nH7PYskhaonl8TXk8byg9KKQzomyZdrqg0WMVxmZtQxDHqCFiPbV2S0E+8+Sa/+hFV6 KIHEBMB5c9Cnq8SMKWDNcCqKJaRi/PUkzdX9YyTMta3kl2PksMtHtVEoApc7pTwXYhME4JPJyfLgF 9lB+aPaL34V9VZD16IK+oydc2ruwRxxkQ1Z5IN7U+ev8r/4UP985hKZW1QbdoVQJWejsnFGznitlr sI39VxHg==; Received: from [2001:4bb8:18c:28b5:44f9:d544:957f:32cb] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.92 #3 (Red Hat Linux)) id 1hytSK-0005Ci-OB; Sat, 17 Aug 2019 07:48:57 +0000 From: Christoph Hellwig To: Arnd Bergmann , Guo Ren , Michal Simek , Greentime Hu , Vincent Chen , Guan Xuetao , x86@kernel.org Cc: linux-alpha@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-hexagon@vger.kernel.org, linux-ia64@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, nios2-dev@lists.rocketboards.org, openrisc@lists.librecores.org, linux-parisc@vger.kernel.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org, linux-xtensa@linux-xtensa.org, linux-mtd@lists.infradead.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 15/26] asm-generic: ioremap_uc should behave the same with and without MMU Date: Sat, 17 Aug 2019 09:32:42 +0200 Message-Id: <20190817073253.27819-16-hch@lst.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190817073253.27819-1-hch@lst.de> References: <20190817073253.27819-1-hch@lst.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Whatever reason there is for the existence of ioremap_uc, and the fact that it returns NULL by default on architectures with an MMU applies equally to nommu architectures, so don't provide different defaults. In practice the difference is meaningless as the only portable driver that uses ioremap_uc is atyfb which probably doesn't show up on nommu devices. Signed-off-by: Christoph Hellwig --- include/asm-generic/io.h | 36 ++++++++++++++++-------------------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h index d02806513670..a98ed6325727 100644 --- a/include/asm-generic/io.h +++ b/include/asm-generic/io.h @@ -935,18 +935,7 @@ static inline void *phys_to_virt(unsigned long address) * defined your own ioremap_*() variant you must then declare your own * ioremap_*() variant as defined to itself to avoid the default NULL return. */ - -#ifdef CONFIG_MMU - -#ifndef ioremap_uc -#define ioremap_uc ioremap_uc -static inline void __iomem *ioremap_uc(phys_addr_t offset, size_t size) -{ - return NULL; -} -#endif - -#else /* !CONFIG_MMU */ +#ifndef CONFIG_MMU /* * Change "struct page" to physical address. @@ -980,14 +969,6 @@ static inline void __iomem *ioremap_nocache(phys_addr_t offset, size_t size) } #endif -#ifndef ioremap_uc -#define ioremap_uc ioremap_uc -static inline void __iomem *ioremap_uc(phys_addr_t offset, size_t size) -{ - return ioremap_nocache(offset, size); -} -#endif - #ifndef ioremap_wc #define ioremap_wc ioremap_wc static inline void __iomem *ioremap_wc(phys_addr_t offset, size_t size) @@ -1004,6 +985,21 @@ static inline void __iomem *ioremap_wt(phys_addr_t offset, size_t size) } #endif +/* + * ioremap_uc is special in that we do require an explicit architecture + * implementation. In general you do now want to use this function in a + * driver and use plain ioremap, which is uncached by default. Similarly + * architectures should not implement it unless they have a very good + * reason. + */ +#ifndef ioremap_uc +#define ioremap_uc ioremap_uc +static inline void __iomem *ioremap_uc(phys_addr_t offset, size_t size) +{ + return NULL; +} +#endif + #ifdef CONFIG_HAS_IOPORT_MAP #ifndef CONFIG_GENERIC_IOMAP #ifndef ioport_map -- 2.20.1