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=-8.3 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham 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 0E4A9C3A59B for ; Sat, 17 Aug 2019 21:15:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D049F21019 for ; Sat, 17 Aug 2019 21:15:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=sifive.com header.i=@sifive.com header.b="J32rrdBR" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726286AbfHQVPJ (ORCPT ); Sat, 17 Aug 2019 17:15:09 -0400 Received: from mail-io1-f65.google.com ([209.85.166.65]:35206 "EHLO mail-io1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726351AbfHQVPI (ORCPT ); Sat, 17 Aug 2019 17:15:08 -0400 Received: by mail-io1-f65.google.com with SMTP id i22so13229526ioh.2 for ; Sat, 17 Aug 2019 14:15:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=of7+kXZ7O7iQMaD+uR4bskNv7dazvfYrCLyFqQNS+Ys=; b=J32rrdBRvRsfbFjCu9mt8fMYOMslmZza78qiqRkRyerF7Tvcpg2S9u01Ma540XGXA7 2iMu5p3Hkj4aS5LBrD+33KElVbGx/xBadIYVGPANBM7jO6Se6GA6GrwSMEwF29HvJ6ER vZ9LmfwOTrujU/Kp5jYgpxJYxNHczK453ZXPgcwCmkGHcdiVYKwlFvQ6JuUiC1/4nCYl uFAhRB0N/reKVlsdq1bNGymQlRL3HWYkOuH8XT80KfGMY/WL2QfRa8xGoQM4QoYPzMnq iTWN1h7rhUiSs1zoLq4NqE4o/IAPIBBfkwLsR3a1H+aqVN59SAAPttTAgUB3YgtJ2wpS 6ilA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=of7+kXZ7O7iQMaD+uR4bskNv7dazvfYrCLyFqQNS+Ys=; b=KJymDyMNio4Nzvrf1SP4uuSX9I4YVEHSBYwG5lfBerddR3UZ6DJ3CNa0XKPF/0ZoPl EjW84yWMzT/XDqpWmIs8pjh1vziXUADSI7g0GVJk3KmEdeFVKxTOfTDT9LPuxfOVv/2o YAShFjAAVPEt6tz48y3oUcN/AJp3Rqyh+TuItI7sNbR3gzJj9Z2Yy+LYmwHicNOTEZEm Iy3kGcoX+zT4ZGqVTbH5UfE2q1AdMaWxee+BA6PmCyT4Qh7VjnOVcg6oLcA+fPMILGHA /s02suqdhjzUFT5PZzVOhq2Kq3uf1OpyLco5P4Fno58Z5wFMT8ugaUQvL/nbAXx5Ijt/ tS1Q== X-Gm-Message-State: APjAAAVFQDmHASijT+PplFG7zqdXEMvntUBXwHAzqat2yW4DdnvrByIA 2k+Hoyw6ygOd+P/JcRfrtD7gzg== X-Google-Smtp-Source: APXvYqxhPFwhoGwEv9EiCGR2YXAs4N7HYnW3IuL/COnl5kQqZm2U/FQDN7BsZ9+pbm1TtqxdMhb2eg== X-Received: by 2002:a02:654d:: with SMTP id u74mr19023736jab.115.1566076507872; Sat, 17 Aug 2019 14:15:07 -0700 (PDT) Received: from localhost (c-73-95-159-87.hsd1.co.comcast.net. [73.95.159.87]) by smtp.gmail.com with ESMTPSA id z19sm8681923ioh.12.2019.08.17.14.15.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Aug 2019 14:15:07 -0700 (PDT) Date: Sat, 17 Aug 2019 14:15:06 -0700 (PDT) From: Paul Walmsley X-X-Sender: paulw@viisi.sifive.com To: Christoph Hellwig cc: Arnd Bergmann , Guo Ren , Michal Simek , Greentime Hu , Vincent Chen , Guan Xuetao , x86@kernel.org, linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, linux-ia64@vger.kernel.org, linux-parisc@vger.kernel.org, linux-sh@vger.kernel.org, linux-hexagon@vger.kernel.org, linux-xtensa@linux-xtensa.org, linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, linux-m68k@lists.linux-m68k.org, openrisc@lists.librecores.org, linux-mtd@lists.infradead.org, linux-alpha@vger.kernel.org, sparclinux@vger.kernel.org, nios2-dev@lists.rocketboards.org, linux-riscv@lists.infradead.org, linux-snps-arc@lists.infradead.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH 16/26] asm-generic: don't provide ioremap for CONFIG_MMU In-Reply-To: <20190817073253.27819-17-hch@lst.de> Message-ID: References: <20190817073253.27819-1-hch@lst.de> <20190817073253.27819-17-hch@lst.de> User-Agent: Alpine 2.21.9999 (DEB 301 2018-08-15) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org On Sat, 17 Aug 2019, Christoph Hellwig wrote: > All MMU-enabled ports have a non-trivial ioremap and should thus provide > the prototype for their implementation instead of providing a generic > one unless a different symbol is not defined. Note that this only > affects sparc32 nds32 as all others do provide their own version. > > Also update the kerneldoc comments in asm-generic/io.h to explain the > situation around the default ioremap* implementations correctly. > > Signed-off-by: Christoph Hellwig > --- > arch/nds32/include/asm/io.h | 2 ++ > arch/sparc/include/asm/io_32.h | 1 + > include/asm-generic/io.h | 29 ++++++++--------------------- > 3 files changed, 11 insertions(+), 21 deletions(-) > [ ... ] > diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h > index a98ed6325727..6a5edc23afe2 100644 > --- a/include/asm-generic/io.h > +++ b/include/asm-generic/io.h > @@ -922,28 +922,16 @@ static inline void *phys_to_virt(unsigned long address) > /** > * DOC: ioremap() and ioremap_*() variants > * > - * If you have an IOMMU your architecture is expected to have both ioremap() > - * and iounmap() implemented otherwise the asm-generic helpers will provide a > - * direct mapping. > + * Architectures with an MMU are expected to provide ioremap() and iounmap() > + * themselves. For NOMMU architectures we provide a default nop-op > + * implementation that expect that the physical address used for MMIO are > + * already marked as uncached, and can be used as kernel virtual addresses. > * > - * There are ioremap_*() call variants, if you have no IOMMU we naturally will > - * default to direct mapping for all of them, you can override these defaults. > - * If you have an IOMMU you are highly encouraged to provide your own > - * ioremap variant implementation as there currently is no safe architecture > - * agnostic default. To avoid possible improper behaviour default asm-generic > - * ioremap_*() variants all return NULL when an IOMMU is available. If you've > - * defined your own ioremap_*() variant you must then declare your own > - * ioremap_*() variant as defined to itself to avoid the default NULL return. > + * ioremap_wc() and ioremap_wt() can provide more relaxed caching attributes > + * for specific drivers if the architecture choses to implement them. If they ^^^ chooses - Paul