Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1618214

Re: [PATCH v2 02/22] asm-generic/io.h: add ioremap_nopost remap interface

From Russell King - ARM Linux <linux@armlinux.org.uk>
Newsgroups linux.kernel
Subject Re: [PATCH v2 02/22] asm-generic/io.h: add ioremap_nopost remap interface
Date 2017-04-06 19:30 +0200
Message-ID <ttjom-3R8-17@gated-at.bofh.it> (permalink)
References (5 earlier) <tteeZ-81k-1@gated-at.bofh.it> <ttfkJ-ux-11@gated-at.bofh.it> <ttisi-3fg-1@gated-at.bofh.it> <ttiLE-3md-41@gated-at.bofh.it> <ttjeF-3NR-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, Apr 06, 2017 at 06:09:51PM +0100, Lorenzo Pieralisi wrote:
> On Thu, Apr 06, 2017 at 05:40:16PM +0100, Russell King - ARM Linux wrote:
> > On Thu, Apr 06, 2017 at 05:21:56PM +0100, Lorenzo Pieralisi wrote:
> > > Ok, so:
> > > 
> > > (1) I can do asm-generic/ioremap-nopost.h, which I assume you want to
> > >     contain something like
> > > 
> > > static inline void __iomem *ioremap_nopost(phys_addr_t offset, size_t size)
> > > {
> > > 	return ioremap_nocache(offset, size);
> > > }
> > > 
> > > Funny bit is that it has to be included by asm*/io.h files _after_
> > > ioremap_nocache has been #defined (that's the reason my approach was
> > > failing miserably even on arches like eg powerpc (see [1] below) that
> > > does have ioremap_nocache),
> > 
> > PowerPC does have ioremap_nocache() though:
> > 
> > /**
> >  * ioremap     -   map bus memory into CPU space
> > ...
> >  * * ioremap_nocache is identical to ioremap
> > extern void __iomem *ioremap(phys_addr_t address, unsigned long size);
> > #define ioremap_nocache(addr, size)     ioremap((addr), (size))
> > 
> > and this include file is included very early on in linux/io.h.  I don't
> > see anything that conditionalises it on anything except __KERNEL__.  So,
> > the report from 0-day really doesn't make any sense to me.
> > 
> > Do we know how we're ending up in linux/io.h line 169 without having
> > picked up the ioremap_nocache() definition provided by PowerPC's
> > asm/io.h ?
> 
> I will debug it further but I *think* it is because:
> 
> eg arch/powerpc/oprofile/op_model_cell.c includes <asm/io.h>
> 
> and <asm/io.h> includes <linux/io.h> before ioremap_nocache is defined

Oh, that's just very wrong.  asm/foo.h should never include linux/foo.h
especially when linux/foo.h already includes asm/foo.h.  I think we
need PowerPC folk to fix this.

-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH v2 02/22] asm-generic/io.h: add ioremap_nopost remap  interface Bjorn Helgaas <helgaas@kernel.org> - 2017-03-28 03:50 +0200
  Re: [PATCH v2 02/22] asm-generic/io.h: add ioremap_nopost remap  interface Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> - 2017-03-28 16:50 +0200
    Re: [PATCH v2 02/22] asm-generic/io.h: add ioremap_nopost remap  interface Bjorn Helgaas <helgaas@kernel.org> - 2017-03-30 18:50 +0200
    Re: [PATCH v2 02/22] asm-generic/io.h: add ioremap_nopost remap  interface Russell King - ARM Linux <linux@armlinux.org.uk> - 2017-04-05 13:10 +0200
      Re: [PATCH v2 02/22] asm-generic/io.h: add ioremap_nopost remap  interface Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> - 2017-04-05 14:50 +0200
        Re: [PATCH v2 02/22] asm-generic/io.h: add ioremap_nopost remap  interface Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> - 2017-04-06 12:30 +0200
          Re: [PATCH v2 02/22] asm-generic/io.h: add ioremap_nopost remap  interface Russell King - ARM Linux <linux@armlinux.org.uk> - 2017-04-06 12:50 +0200
            Re: [PATCH v2 02/22] asm-generic/io.h: add ioremap_nopost remap  interface Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> - 2017-04-10 16:40 +0200
          Re: [PATCH v2 02/22] asm-generic/io.h: add ioremap_nopost remap  interface "Luis R. Rodriguez" <mcgrof@kernel.org> - 2017-04-06 13:00 +0200
            Re: [PATCH v2 02/22] asm-generic/io.h: add ioremap_nopost remap  interface Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> - 2017-04-06 13:40 +0200
              Re: [PATCH v2 02/22] asm-generic/io.h: add ioremap_nopost remap  interface "Luis R. Rodriguez" <mcgrof@kernel.org> - 2017-04-06 14:00 +0200
                Re: [PATCH v2 02/22] asm-generic/io.h: add ioremap_nopost remap  interface Russell King - ARM Linux <linux@armlinux.org.uk> - 2017-04-06 15:10 +0200
                Re: [PATCH v2 02/22] asm-generic/io.h: add ioremap_nopost remap  interface Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> - 2017-04-06 18:30 +0200
                Re: [PATCH v2 02/22] asm-generic/io.h: add ioremap_nopost remap  interface Russell King - ARM Linux <linux@armlinux.org.uk> - 2017-04-06 18:50 +0200
                Re: [PATCH v2 02/22] asm-generic/io.h: add ioremap_nopost remap  interface Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> - 2017-04-06 19:20 +0200
                Re: [PATCH v2 02/22] asm-generic/io.h: add ioremap_nopost remap  interface Russell King - ARM Linux <linux@armlinux.org.uk> - 2017-04-06 19:30 +0200
            Re: [PATCH v2 02/22] asm-generic/io.h: add ioremap_nopost remap  interface Russell King - ARM Linux <linux@armlinux.org.uk> - 2017-04-06 14:20 +0200
              Re: [PATCH v2 02/22] asm-generic/io.h: add ioremap_nopost remap  interface "Luis R. Rodriguez" <mcgrof@kernel.org> - 2017-04-06 14:30 +0200

csiph-web