From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arnd Bergmann Subject: Re: [PATCH 10/21] asm-generic: ioremap_uc should behave the same with and without MMU Date: Mon, 11 Nov 2019 11:09:05 +0100 Message-ID: References: <20191029064834.23438-1-hch@lst.de> <20191029064834.23438-11-hch@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Return-path: In-Reply-To: <20191029064834.23438-11-hch@lst.de> Sender: linux-kernel-owner@vger.kernel.org To: Christoph Hellwig Cc: Guo Ren , Michal Simek , Greentime Hu , Vincent Chen , Guan Xuetao , the arch/x86 maintainers , alpha , "open list:SYNOPSYS ARC ARCHITECTURE" , Linux ARM , "open list:QUALCOMM HEXAGON..." , linux-ia64@vger.kernel.org, linux-m68k , linux-mips@vger.kernel.org, "moderated list:NIOS2 ARCHITECTURE" , openrisc@lists.librecores.org, Parisc List , linux-riscv@lists.infradead.org, linux-s390 List-Id: linux-arch.vger.kernel.org On Tue, Oct 29, 2019 at 7:49 AM 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. Makes sense. > 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. > +/* > + * 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 Maybe we could move the definition into the atyfb driver itself? As I understand it, the difference between ioremap()/ioremap_nocache() and ioremap_uc() only exists on pre-PAT x86-32 systems (i.e. 486, P5, Ppro, PII, K6, VIA C3), while on more modern systems (all non-x86, PentiumIII, Athlon, VIA C7) those three are meant to be synonyms anyway. Arnd From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout.kundenserver.de ([217.72.192.75]:51191 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726791AbfKKKJ1 (ORCPT ); Mon, 11 Nov 2019 05:09:27 -0500 MIME-Version: 1.0 References: <20191029064834.23438-1-hch@lst.de> <20191029064834.23438-11-hch@lst.de> In-Reply-To: <20191029064834.23438-11-hch@lst.de> From: Arnd Bergmann Date: Mon, 11 Nov 2019 11:09:05 +0100 Message-ID: Subject: Re: [PATCH 10/21] asm-generic: ioremap_uc should behave the same with and without MMU Content-Type: text/plain; charset="UTF-8" Sender: linux-arch-owner@vger.kernel.org List-ID: To: Christoph Hellwig Cc: Guo Ren , Michal Simek , Greentime Hu , Vincent Chen , Guan Xuetao , the arch/x86 maintainers , alpha , "open list:SYNOPSYS ARC ARCHITECTURE" , Linux ARM , "open list:QUALCOMM HEXAGON..." , linux-ia64@vger.kernel.org, linux-m68k , linux-mips@vger.kernel.org, "moderated list:NIOS2 ARCHITECTURE" , openrisc@lists.librecores.org, Parisc List , linux-riscv@lists.infradead.org, linux-s390 , Linux-sh list , sparclinux , linux-xtensa@linux-xtensa.org, linux-mtd , linux-arch , "linux-kernel@vger.kernel.org" Message-ID: <20191111100905.zXkgatepBv_NuzNOFEc17siZv78W1Tpyh0CGwjZ3fmM@z> On Tue, Oct 29, 2019 at 7:49 AM 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. Makes sense. > 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. > +/* > + * 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 Maybe we could move the definition into the atyfb driver itself? As I understand it, the difference between ioremap()/ioremap_nocache() and ioremap_uc() only exists on pre-PAT x86-32 systems (i.e. 486, P5, Ppro, PII, K6, VIA C3), while on more modern systems (all non-x86, PentiumIII, Athlon, VIA C7) those three are meant to be synonyms anyway. Arnd