diff for duplicates of <20170418110350.GA1941@red-moon> diff --git a/a/1.txt b/N1/1.txt index 7f4ae89..98de2da 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -3,26 +3,37 @@ On Tue, Apr 18, 2017 at 08:36:48PM +1000, Benjamin Herrenschmidt wrote: > > I can add a defined(pgprot_nonposted) to pci_remap_iospace() if that's > > not too ugly (I suspect Bjorn is thrilled about it :)), that plus > > the Kconfig option for ioremap_nopost() should complete this series. -> > +> > = + > > int pci_remap_iospace(const struct resource *res, phys_addr_t phys_addr) > > { -> > #if defined(PCI_IOBASE) && defined(CONFIG_MMU) && defined(pgprot_nonposted) -> > unsigned long vaddr = (unsigned long)PCI_IOBASE + res->start; -> > -> > if (!(res->flags & IORESOURCE_IO)) -> > return -EINVAL; -> > -> > if (res->end > IO_SPACE_LIMIT) -> > return -EINVAL -> > return ioremap_page_range(vaddr, vaddr + resource_size(res), phys_addr, -> > pgprot_nonposted(PAGE_KERNEL)); +> > #if defined(PCI_IOBASE) && defined(CONFIG_MMU) && defined(pgprot_nonpos= +ted) +> > =A0=A0=A0=A0=A0=A0=A0=A0unsigned long vaddr =3D (unsigned long)PCI_IOBA= +SE + res->start; +> > = + +> > =A0=A0=A0=A0=A0=A0=A0=A0if (!(res->flags & IORESOURCE_IO)) +> > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0return -EINVAL; +> > = + +> > =A0=A0=A0=A0=A0=A0=A0=A0if (res->end > IO_SPACE_LIMIT) +> > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0return -EINVAL +> > =A0=A0=A0=A0=A0=A0=A0=A0return ioremap_page_range(vaddr, vaddr + resour= +ce_size(res), phys_addr, +> > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 pgprot_nonposted(PAGE_KERNEL)); > > #else -> > /* this architecture does not have memory mapped I/O space, -> > so this function should never be called */ -> > WARN_ONCE(1, "This architecture does not support memory mapped I/O\n"); -> > return -ENODEV; +> > =A0=A0=A0=A0=A0=A0=A0=A0/* this architecture does not have memory mappe= +d I/O space, +> > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 so this function should never be called = +*/ +> > =A0=A0=A0=A0=A0=A0=A0=A0WARN_ONCE(1, "This architecture does not suppor= +t memory mapped I/O\n"); +> > =A0=A0=A0=A0=A0=A0=A0=A0return -ENODEV; > > #endif -> +> = + > The above would effectively disable mmap'ing of IO space for any > architecture that doesn't have pgprot_nonposted... so everybody except > ARM. Thus breaking a number of systems that have been working fine for @@ -33,21 +44,25 @@ what I would actually break (and I am not sure at all how well PCI IO space is tested on ARM/ARM64 machines anyway). > I fail to see the point.... -> +> = + > I think you are giving the whole non-posted stuff way more importance > than it deserves. It's originally a kludge Intel did to PCI because it > well with their synchronous IO space, which was itself a remnant of > pre-history that should have long died. -> +> = + > In the specific case of PCI (again I'm not talking about the general > case of pgprot/ioremap_nonposted), we have routinely been "violating" > that rule, at least on the CPU -> PCI Bridge path (the PCI bridge > itself tends to respect it though I've seen exceptions) for decades > without any adverse effect. -> +> = + > I don't think there's much code (if any) out there which actually > relies on the non-posted characteristics of IO space. -> +> = + > I don't care *that* much mind you, we dropped IO space on PCI with > POWER8, but it would break stuff on existing older machines such as > PowerMacs for no good reason. @@ -69,3 +84,8 @@ space. Thanks, Lorenzo + +_______________________________________________ +linux-arm-kernel mailing list +linux-arm-kernel@lists.infradead.org +http://lists.infradead.org/mailman/listinfo/linux-arm-kernel diff --git a/a/content_digest b/N1/content_digest index 3486139..afa8c45 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -35,7 +35,30 @@ Catalin Marinas <catalin.marinas@arm.com> Matt Turner <mattst88@gmail.com> Haavard Skinnemoen <hskinnemoen@gmail.com> - " Fenghua Yu <fenghua>\0" + Fenghua Yu <fenghua.yu@intel.com> + James Hogan <james.hogan@imgtec.com> + Chris Metcalf <cmetcalf@mellanox.com> + Arnd Bergmann <arnd@arndb.de> + Heiko Carstens <heiko.carstens@de.ibm.com> + Stefan Kristiansson <stefan.kristiansson@saunalahti.fi> + Mikael Starvik <starvik@axis.com> + Ivan Kokshaysky <ink@jurassic.park.msu.ru> + Bjorn Helgaas <bhelgaas@google.com> + Stafford Horne <shorne@gmail.com> + linux-arm-kernel@lists.infradead.org + Richard Henderson <rth@twiddle.net> + Chris Zankel <chris@zankel.net> + Michal Simek <monstr@monstr.eu> + Tony Luck <tony.luck@intel.com> + Vineet Gupta <vgupta@synopsys.com> + linux-kernel@vger.kernel.org + Ralf Baechle <ralf@linux-mips.org> + Richard Kuo <rkuo@codeaurora.org> + Niklas Cassel <nks@flawful.org> + Luis R. Rodriguez <mcgrof@kernel.org> + Martin Schwidefsky <schwidefsky@de.ibm.com> + Ley Foon Tan <lftan@altera.com> + " David S. Miller <davem@davemloft.net>\0" "\00:1\0" "b\0" "On Tue, Apr 18, 2017 at 08:36:48PM +1000, Benjamin Herrenschmidt wrote:\n" @@ -43,26 +66,37 @@ "> > I can add a defined(pgprot_nonposted) to pci_remap_iospace() if that's\n" "> > not too ugly (I suspect Bjorn is thrilled about it :)), that plus\n" "> > the Kconfig option for ioremap_nopost() should complete this series.\n" - "> > \n" + "> > =\n" + "\n" "> > int pci_remap_iospace(const struct resource *res, phys_addr_t phys_addr)\n" "> > {\n" - "> > #if defined(PCI_IOBASE) && defined(CONFIG_MMU) && defined(pgprot_nonposted)\n" - "> > \302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240unsigned long vaddr = (unsigned long)PCI_IOBASE + res->start;\n" - "> > \n" - "> > \302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240if (!(res->flags & IORESOURCE_IO))\n" - "> > \302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240return -EINVAL;\n" - "> > \n" - "> > \302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240if (res->end > IO_SPACE_LIMIT)\n" - "> > \302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240return -EINVAL\n" - "> > \302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240return ioremap_page_range(vaddr, vaddr + resource_size(res), phys_addr,\n" - "> > \302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240 pgprot_nonposted(PAGE_KERNEL));\n" + "> > #if defined(PCI_IOBASE) && defined(CONFIG_MMU) && defined(pgprot_nonpos=\n" + "ted)\n" + "> > =A0=A0=A0=A0=A0=A0=A0=A0unsigned long vaddr =3D (unsigned long)PCI_IOBA=\n" + "SE + res->start;\n" + "> > =\n" + "\n" + "> > =A0=A0=A0=A0=A0=A0=A0=A0if (!(res->flags & IORESOURCE_IO))\n" + "> > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0return -EINVAL;\n" + "> > =\n" + "\n" + "> > =A0=A0=A0=A0=A0=A0=A0=A0if (res->end > IO_SPACE_LIMIT)\n" + "> > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0return -EINVAL\n" + "> > =A0=A0=A0=A0=A0=A0=A0=A0return ioremap_page_range(vaddr, vaddr + resour=\n" + "ce_size(res), phys_addr,\n" + "> > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=\n" + "=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 pgprot_nonposted(PAGE_KERNEL));\n" "> > #else\n" - "> > \302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240/* this architecture does not have memory mapped I/O space,\n" - "> > \302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240 so this function should never be called */\n" - "> > \302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240WARN_ONCE(1, \"This architecture does not support memory mapped I/O\\n\");\n" - "> > \302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240return -ENODEV;\n" + "> > =A0=A0=A0=A0=A0=A0=A0=A0/* this architecture does not have memory mappe=\n" + "d I/O space,\n" + "> > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 so this function should never be called =\n" + "*/\n" + "> > =A0=A0=A0=A0=A0=A0=A0=A0WARN_ONCE(1, \"This architecture does not suppor=\n" + "t memory mapped I/O\\n\");\n" + "> > =A0=A0=A0=A0=A0=A0=A0=A0return -ENODEV;\n" "> > #endif\n" - "> \n" + "> =\n" + "\n" "> The above would effectively disable mmap'ing of IO space for any\n" "> architecture that doesn't have pgprot_nonposted... so everybody except\n" "> ARM. Thus breaking a number of systems that have been working fine for\n" @@ -73,21 +107,25 @@ "space is tested on ARM/ARM64 machines anyway).\n" "\n" "> I fail to see the point....\n" - "> \n" + "> =\n" + "\n" "> I think you are giving the whole non-posted stuff way more importance\n" "> than it deserves. It's originally a kludge Intel did to PCI because it\n" "> well with their synchronous IO space, which was itself a remnant of\n" "> pre-history that should have long died.\n" - "> \n" + "> =\n" + "\n" "> In the specific case of PCI (again I'm not talking about the general\n" "> case of pgprot/ioremap_nonposted), we have routinely been \"violating\"\n" "> that rule, at least on the CPU -> PCI Bridge path (the PCI bridge\n" "> itself tends to respect it though I've seen exceptions) for decades\n" "> without any adverse effect.\n" - "> \n" + "> =\n" + "\n" "> I don't think there's much code (if any) out there which actually\n" "> relies on the non-posted characteristics of IO space.\n" - "> \n" + "> =\n" + "\n" "> I don't care *that* much mind you, we dropped IO space on PCI with\n" "> POWER8, but it would break stuff on existing older machines such as\n" "> PowerMacs for no good reason.\n" @@ -108,6 +146,11 @@ "space.\n" "\n" "Thanks,\n" - Lorenzo + "Lorenzo\n" + "\n" + "_______________________________________________\n" + "linux-arm-kernel mailing list\n" + "linux-arm-kernel@lists.infradead.org\n" + http://lists.infradead.org/mailman/listinfo/linux-arm-kernel -5ccbcf1cad40bc820d9c7a54a67f81572aa43d6250895a260b92dc4fccbef484 +5391d7b9ecdf4e4a355e59859ffd81b849dd11532580d0a797bdad9514a64e1a
diff --git a/a/1.txt b/N2/1.txt index 7f4ae89..59d4426 100644 --- a/a/1.txt +++ b/N2/1.txt @@ -7,20 +7,20 @@ On Tue, Apr 18, 2017 at 08:36:48PM +1000, Benjamin Herrenschmidt wrote: > > int pci_remap_iospace(const struct resource *res, phys_addr_t phys_addr) > > { > > #if defined(PCI_IOBASE) && defined(CONFIG_MMU) && defined(pgprot_nonposted) -> > unsigned long vaddr = (unsigned long)PCI_IOBASE + res->start; +> > ????????unsigned long vaddr = (unsigned long)PCI_IOBASE + res->start; > > -> > if (!(res->flags & IORESOURCE_IO)) -> > return -EINVAL; +> > ????????if (!(res->flags & IORESOURCE_IO)) +> > ????????????????return -EINVAL; > > -> > if (res->end > IO_SPACE_LIMIT) -> > return -EINVAL -> > return ioremap_page_range(vaddr, vaddr + resource_size(res), phys_addr, -> > pgprot_nonposted(PAGE_KERNEL)); +> > ????????if (res->end > IO_SPACE_LIMIT) +> > ????????????????return -EINVAL +> > ????????return ioremap_page_range(vaddr, vaddr + resource_size(res), phys_addr, +> > ????????????????????????????????? pgprot_nonposted(PAGE_KERNEL)); > > #else -> > /* this architecture does not have memory mapped I/O space, -> > so this function should never be called */ -> > WARN_ONCE(1, "This architecture does not support memory mapped I/O\n"); -> > return -ENODEV; +> > ????????/* this architecture does not have memory mapped I/O space, +> > ?????????? so this function should never be called */ +> > ????????WARN_ONCE(1, "This architecture does not support memory mapped I/O\n"); +> > ????????return -ENODEV; > > #endif > > The above would effectively disable mmap'ing of IO space for any diff --git a/a/content_digest b/N2/content_digest index 3486139..33e7111 100644 --- a/a/content_digest +++ b/N2/content_digest @@ -8,34 +8,10 @@ "ref\01492044780.7236.87.camel@kernel.crashing.org\0" "ref\020170418085732.GA23882@red-moon\0" "ref\01492511808.25766.91.camel@kernel.crashing.org\0" - "From\0Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>\0" - "Subject\0Re: [PATCH v3 00/32] PCI: fix config and I/O Address space memory mappings\0" + "From\0lorenzo.pieralisi@arm.com (Lorenzo Pieralisi)\0" + "Subject\0[PATCH v3 00/32] PCI: fix config and I/O Address space memory mappings\0" "Date\0Tue, 18 Apr 2017 12:03:50 +0100\0" - "To\0Benjamin Herrenschmidt <benh@kernel.crashing.org>\0" - "Cc\0Jonas Bonn <jonas@southpole.se>" - Rich Felker <dalias@libc.org> - linux-pci@vger.kernel.org - Will Deacon <will.deacon@arm.com> - James E.J. Bottomley <jejb@parisc-linux.org> - David Howells <dhowells@redhat.com> - Max Filippov <jcmvbkbc@gmail.com> - Paul Mackerras <paulus@samba.org> - Huacai Chen <chenhc@lemote.com> - Guan Xuetao <gxt@mprc.pku.edu.cn> - Thomas Gleixner <tglx@linutronix.de> - Hans-Christian Egtvedt <egtvedt@samfundet.no> - linux-arch@vger.kernel.org - Jesper Nilsson <jesper.nilsson@axis.com> - Yoshinori Sato <ysato@users.sourceforge.jp> - Michael Ellerman <mpe@ellerman.id.au> - Helge Deller <deller@gmx.de> - Russell King - ARM Linux <linux@armlinux.org.uk> - Ingo Molnar <mingo@redhat.com> - Geert Uytterhoeven <geert@linux-m68k.org> - Catalin Marinas <catalin.marinas@arm.com> - Matt Turner <mattst88@gmail.com> - Haavard Skinnemoen <hskinnemoen@gmail.com> - " Fenghua Yu <fenghua>\0" + "To\0linux-arm-kernel@lists.infradead.org\0" "\00:1\0" "b\0" "On Tue, Apr 18, 2017 at 08:36:48PM +1000, Benjamin Herrenschmidt wrote:\n" @@ -47,20 +23,20 @@ "> > int pci_remap_iospace(const struct resource *res, phys_addr_t phys_addr)\n" "> > {\n" "> > #if defined(PCI_IOBASE) && defined(CONFIG_MMU) && defined(pgprot_nonposted)\n" - "> > \302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240unsigned long vaddr = (unsigned long)PCI_IOBASE + res->start;\n" + "> > ????????unsigned long vaddr = (unsigned long)PCI_IOBASE + res->start;\n" "> > \n" - "> > \302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240if (!(res->flags & IORESOURCE_IO))\n" - "> > \302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240return -EINVAL;\n" + "> > ????????if (!(res->flags & IORESOURCE_IO))\n" + "> > ????????????????return -EINVAL;\n" "> > \n" - "> > \302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240if (res->end > IO_SPACE_LIMIT)\n" - "> > \302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240return -EINVAL\n" - "> > \302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240return ioremap_page_range(vaddr, vaddr + resource_size(res), phys_addr,\n" - "> > \302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240 pgprot_nonposted(PAGE_KERNEL));\n" + "> > ????????if (res->end > IO_SPACE_LIMIT)\n" + "> > ????????????????return -EINVAL\n" + "> > ????????return ioremap_page_range(vaddr, vaddr + resource_size(res), phys_addr,\n" + "> > ????????????????????????????????? pgprot_nonposted(PAGE_KERNEL));\n" "> > #else\n" - "> > \302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240/* this architecture does not have memory mapped I/O space,\n" - "> > \302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240 so this function should never be called */\n" - "> > \302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240WARN_ONCE(1, \"This architecture does not support memory mapped I/O\\n\");\n" - "> > \302\240\302\240\302\240\302\240\302\240\302\240\302\240\302\240return -ENODEV;\n" + "> > ????????/* this architecture does not have memory mapped I/O space,\n" + "> > ?????????? so this function should never be called */\n" + "> > ????????WARN_ONCE(1, \"This architecture does not support memory mapped I/O\\n\");\n" + "> > ????????return -ENODEV;\n" "> > #endif\n" "> \n" "> The above would effectively disable mmap'ing of IO space for any\n" @@ -110,4 +86,4 @@ "Thanks,\n" Lorenzo -5ccbcf1cad40bc820d9c7a54a67f81572aa43d6250895a260b92dc4fccbef484 +50d3465428b146463d9f451911d43addfd4d4dbcca30728893705601187bbbd2
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.