From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.7 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3EED7C5DF65 for ; Wed, 6 Nov 2019 17:56:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 14418217F5 for ; Wed, 6 Nov 2019 17:56:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=dabbelt-com.20150623.gappssmtp.com header.i=@dabbelt-com.20150623.gappssmtp.com header.b="PGZwZeqh" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732465AbfKFR4i (ORCPT ); Wed, 6 Nov 2019 12:56:38 -0500 Received: from mail-pg1-f195.google.com ([209.85.215.195]:37717 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732462AbfKFR4h (ORCPT ); Wed, 6 Nov 2019 12:56:37 -0500 Received: by mail-pg1-f195.google.com with SMTP id z24so13101529pgu.4 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=UfmQ/cmbmYGk1o7+K9JiTMQ1Qz6v1fdbSYa4NfCHA6bInIVkmARsSPTc9HPLtiKORs nlQ84RWV9z5eBDWvKOSlPX2Ka4RKb3d/J5f6/t+8D4PZiKh4LFVdKrpeO9S7SjSxZIez ppxkTAbREVGxofZEFaKvpAYTeODbX4Bdi1kidQ8+r+2u2X1N+0EDzsekn8wUMA7PNh5j rWHKRS3wfoIjtNWMA//Fo73C/IvL9YY8xpiE9SeelrhDrMWhHnJ2/74xEsDEm+Fw2rUO q1krRguN2oL7cP2ugSE5ffDdoPd3hHVrg5of+0vLQF35ecBRhxcw8P5S7lCbSMxfCqEZ fjgg== X-Gm-Message-State: APjAAAUxk4izFVz+5T8sPI4ZCffAnrBJKDgQ47vuPMToXLtXq16uXsII QcedytsbjYUESlORbEhhUZDhog== X-Google-Smtp-Source: APXvYqyZI0/opOONYHdOR3l6SH/z69P+ajsTKg8L6ObdzcVPlsahU45e+bD0ChxR/pgAJsTDNgZ9EA== 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-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@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