Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752759AbdCPUq4 (ORCPT ); Thu, 16 Mar 2017 16:46:56 -0400 Received: from mail-lf0-f67.google.com ([209.85.215.67]:33733 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751663AbdCPUqy (ORCPT ); Thu, 16 Mar 2017 16:46:54 -0400 MIME-Version: 1.0 Reply-To: bjorn@helgaas.com In-Reply-To: <1436488096-3165-1-git-send-email-mcgrof@do-not-panic.com> References: <1436488096-3165-1-git-send-email-mcgrof@do-not-panic.com> From: Bjorn Helgaas Date: Thu, 16 Mar 2017 15:46:51 -0500 Message-ID: Subject: Re: [PATCH v1] x86/mm, asm-generic: Add IOMMU ioremap_uc() variant default To: "Luis R. Rodriguez" Cc: mingo@kernel.org, bp@suse.de, arnd@arndb.de, dan.j.williams@intel.com, Christoph Hellwig , luto@amacapital.net, hpa@zytor.com, tglx@linutronix.de, geert@linux-m68k.org, ralf@linux-mips.org, hmh@hmh.eng.br, ross.zwisler@linux.intel.com, akpm@linux-foundation.org, jgross@suse.com, Benjamin Herrenschmidt , mpe@ellerman.id.au, tj@kernel.org, x86 , tomi.valkeinen@ti.com, mst@redhat.com, toshi.kani@hp.com, stefan.bader@canonical.com, linux-mm@kvack.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, "Luis R. Rodriguez" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1946 Lines: 55 On Thu, Jul 9, 2015 at 7:28 PM, Luis R. Rodriguez wrote: > +/** > + * 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. > + * > + * 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. Are the references above to "IOMMU" typos? Should they say "MMU" instead, so they match the #ifdef below? > + */ > + > +#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 */ > + > /* > * Change "struct page" to physical address. > * > @@ -743,7 +772,6 @@ static inline void *phys_to_virt(unsigned long address) > * you'll need to provide your own definitions. > */ > > -#ifndef CONFIG_MMU > #ifndef ioremap > #define ioremap ioremap > static inline void __iomem *ioremap(phys_addr_t offset, size_t size) > -- > 2.3.2.209.gd67f9d5.dirty > > -- > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > Please read the FAQ at http://www.tux.org/lkml/