Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp893454ybx; Wed, 6 Nov 2019 09:57:56 -0800 (PST) X-Google-Smtp-Source: APXvYqxZH4AeZh7MjbMALIyYIABZABvRZ8tBpiHrhdJ+eDoCYtwxxzUdr6saJ/I6cUeZN0PkHnnm X-Received: by 2002:a17:906:6b94:: with SMTP id l20mr33399309ejr.238.1573063076710; Wed, 06 Nov 2019 09:57:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573063076; cv=none; d=google.com; s=arc-20160816; b=DUGEApDsV0C5Y7RTNe70YH7HIHgxkLIlVgXSFfaeAy84amfXBgDGIAqvg7WYRIZQkK aTfWolOuL0SbZyivjqfiH4Tu33bSyEsTf7IPDAuhHbsZpmv0yZ4XROue2q7IVqSi5hZl pccLR2rQVKt2kkfKPEPGjWtnjW3I4iWdVni+4xET8ysbBIgJetAwBDf1QGbZj/nUCZf8 IzfBfaaVkd2i7M2An8+CTC59HS+mf6yHnVga7Jwh8NTxl45Ezg5lwlVLifNnTNFawL7Z Cj9TqtjDhYvPz14fP3HeserIQH4p9vl17wnQ+OZAb+ljl7bI6xea//GF2YNC9ymbvAsv eM9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:to:from:cc:in-reply-to:subject :date:dkim-signature; bh=xZW1gMrCUoJqpGWBEYHWFfV09K+K/0uVmzI4MIoxGS8=; b=J+wxzmIxFn7cAnsQk8DA6laVqVd7Qgv9TwmYYpCSVJExfNPzDgt6smb4Gza7oK0flN /5mFb9+kCERQoLrWGKi3HiEj84QRh/ih4Ilkmq/LgAF2j8HFy5hhDNtm0+BhW6ehcupL KtA3GTkqZtQZNaw9E2n8H9zqeWhflxnOJA0hndAkjOAa5PQU68T+ww5T3Wghb9lumHfT zUEordqYB8UyECCRnz0LzDakS8p1nTVUu/efzpe9Do4Ru5ERZ07WFqnyBqzAvrslIekC OJm4Kpi6oQR1EXLcxQxCLqhBSasp635wfoA0vmvqgr+LlVhYr72zWEczfGiaxuWo+cDa /zLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@dabbelt-com.20150623.gappssmtp.com header.s=20150623 header.b=PGZwZeqh; 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 y61si13794326ede.24.2019.11.06.09.57.32; Wed, 06 Nov 2019 09:57:56 -0800 (PST) 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=pass header.i=@dabbelt-com.20150623.gappssmtp.com header.s=20150623 header.b=PGZwZeqh; 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 S1732452AbfKFR4g (ORCPT + 99 others); Wed, 6 Nov 2019 12:56:36 -0500 Received: from mail-pf1-f196.google.com ([209.85.210.196]:40078 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732379AbfKFR4g (ORCPT ); Wed, 6 Nov 2019 12:56:36 -0500 Received: by mail-pf1-f196.google.com with SMTP id r4so19482508pfl.7 for ; Wed, 06 Nov 2019 09:56:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dabbelt-com.20150623.gappssmtp.com; s=20150623; h=date:subject:in-reply-to:cc:from:to:message-id; bh=xZW1gMrCUoJqpGWBEYHWFfV09K+K/0uVmzI4MIoxGS8=; b=PGZwZeqhjPGqmbBUrw44Auucb8k6dPtlYxXbuNpTAeEMGmKlsnFWXhrKzSARRD1P5Z ofkafacEFrUvuMMQ8srHmApZNGXOM2FXgWNtdGS1rg8UPKc85d79tzD5/t3BF7GMjDtX WoCFpoFoR/nlY6sa8P7ME55iO2h9Yfcb7ZSd7Zw+om2XJAjYyCK0yIJtNHDyXsnWFiZL JcRZR97cwQ2ZvZRsXx81CQhAqwyUUPUY90oJrysCQQ7l1b0iCyPludGEBBLbIE1elh0S JIqszC7OB8xZ2n5/8rEoDBU7MzMibg41EDmgXW2rJwIAtaViAg8zHwFVYITgL2sVpvu1 UzBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:subject:in-reply-to:cc:from:to:message-id; bh=xZW1gMrCUoJqpGWBEYHWFfV09K+K/0uVmzI4MIoxGS8=; b=gkvvbUjiuPuahG6NamUw4Zb/6xKnYhsbi1PYzaCX4BPBsAghlQ/SGnHjbP1z77zjMz FddC24zEqbSOUcA2vkdGtkqIvGgyMcl+rSdeoHPRulifuaYQtgjPlsSQrlbKDZ6EB/EY dvhpLd8pOSKCHITs57IKbd1Xjm4hqibvW4G3aBkrBZsoUP97fKZ15SeJL6aA3QaTvwP6 ZYGgEYOpJNtGdjL686Fj8Zii+Irt7XZV90FxNPWQdh8Myub7Y4QJRvlyc96KBMjntrNU XaGH4ouxYaylh/LOF0dezK1DyTK6qKA4fZlzXULLbG07caEJIKjkBdv+seWoYhRBxZbZ 6jPw== X-Gm-Message-State: APjAAAX+i+RZjgwt0f7e0a/r8+yv7HPnr6OGi9fxb7rRGplEik3Acp0C 5f9jnB54RLDXrDyfsnHeq1r/jA== X-Received: by 2002:a17:90a:340c:: with SMTP id o12mr5529604pjb.18.1573062994968; Wed, 06 Nov 2019 09:56:34 -0800 (PST) Received: from localhost ([12.206.222.5]) by smtp.gmail.com with ESMTPSA id z11sm32745913pfg.117.2019.11.06.09.56.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Nov 2019 09:56:34 -0800 (PST) Date: Wed, 06 Nov 2019 09:56:34 -0800 (PST) X-Google-Original-Date: Wed, 06 Nov 2019 09:56:23 PST (-0800) Subject: Re: [PATCH 10/21] asm-generic: ioremap_uc should behave the same with and without MMU In-Reply-To: <20191029064834.23438-11-hch@lst.de> CC: Arnd Bergmann , guoren@kernel.org, monstr@monstr.eu, green.hu@gmail.com, deanbo422@gmail.com, gxt@pku.edu.cn, x86@kernel.org, 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 From: Palmer Dabbelt To: Christoph Hellwig Message-ID: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 28 Oct 2019 23:48:23 PDT (-0700), Christoph Hellwig wrote: > 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 Presumably that's supposed to be "do not want to use"? > + * 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 With the fix: Reviewed-by: Palmer Dabbelt