Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp936800ybl; Sat, 17 Aug 2019 14:16:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqwVxXYPuqFCTtXN39yeo1ztYbbCThYa0aPeNNGaKMhOIYpqKOmirMpHSuxxIlxXcSkcNwoW X-Received: by 2002:a63:8f55:: with SMTP id r21mr13333139pgn.318.1566076572365; Sat, 17 Aug 2019 14:16:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566076572; cv=none; d=google.com; s=arc-20160816; b=QGBoIwHDcWp61AUxzsCRaaYjpjAfxwHtTNgLMtoIxIASkDcNiiM7H+WO1w+5cUyo7D H0axDTLduenJkfgJRN9H6o/tP0Or5eNi6Qct0MyCnXC7LpzbR7XwCm4x8khqPUrFPYan bZ1+8GrKD042hMhljH6YbKrSCO+3uKZIHNs8xNUe9K9ru2FIY+o9pwVJXmU5Kg58M4XY Z+e91oHelAmhc/WEbVtCUUR8JOLh/hMlTWGuTUgwWYbW3NCVrD5fzo8R5K8SFPnQvdFg OjPVoJWXyf/uljgLTopHFxNK1kjc65Fmym9OmPHcfSx7VcsJp9atrAM3HF0TYZsZjXif h3PQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date:dkim-signature; bh=of7+kXZ7O7iQMaD+uR4bskNv7dazvfYrCLyFqQNS+Ys=; b=Bqu1uWr5bs1MWyr+8GNyKDosPPMeFPza/r28RmQMN3zYZmYeZwqEr/zJa9fz6nj3Qx IuvTGKsBBW3AfVHqdq5aYVMSbVuovFi+fYocj6J/LIzECpSwA8yKpHeJ5u06B5t86Vwd OI85roFyqkbnG8Lt/9nhJCgmejKhphhxDs47FE8dxk0VuvYTpDXyLKBLWhEPr1xsVZR4 EldChKW1qlnkz1eFBnDjCvqx9fEO0e6VnYie3bNbTwJMraESK1XV4324g/kUjwBreXSw G0xYkrIO5riAYi8mvo0REndZOq/crV+o+Rrz44E8tMS+KalCaHhIgK8qPlRiqZ89dgyC IUEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=J32rrdBR; 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 c127si7097330pfc.191.2019.08.17.14.15.58; Sat, 17 Aug 2019 14:16:12 -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=pass header.i=@sifive.com header.s=google header.b=J32rrdBR; 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 S1726406AbfHQVPK (ORCPT + 99 others); Sat, 17 Aug 2019 17:15:10 -0400 Received: from mail-io1-f68.google.com ([209.85.166.68]:38935 "EHLO mail-io1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726229AbfHQVPI (ORCPT ); Sat, 17 Aug 2019 17:15:08 -0400 Received: by mail-io1-f68.google.com with SMTP id l7so13232521ioj.6 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=gWlRUuT8xnz0OBPkQ9ecxsyvfuupOcEVi17KXcu2o+EC03z921M8u/DMIsJuVfdK5d mxZJ70+gbv+Q9fLnzGbjyrVb5CNswaYOVGQCXvYmU/Zln0BS/d/egUxT7Bmo0zqpUOL2 1eqRpUxCoO5ZaN/cdo0ZxlMQfiTk35JaVmDMvzpZrNiX4TEOPqEAboBB8uus9iqoyd8P JhC846w+CuNjkqz9ZBRvpy9wvTFbPh57xZuH5g7yliqie0pe3l2kxaK0Rf2lHjyGrI26 oqimIF6uMV9fnQuvkwbJUJPILIV1L81orQUdtmEen09wzLg7L6j6LlxNHRv0OtMU++Gs AEZQ== X-Gm-Message-State: APjAAAVZdH0czJKKiCpmjgxoIUD0T+fdrKry83ITjnPea19n7xbyV+hX 9c/ImA2pvTczr47r/+kaGRuvQQ== 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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