linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: Build breakage from 'ARM: mm: use phys_addr_t appropriately in p2v and v2p conversions'
Date: Tue, 26 Nov 2013 17:36:59 +0000	[thread overview]
Message-ID: <20131126173659.GE16735@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <alpine.LFD.2.10.1311261205300.9667@knanqh.ubzr>

On Tue, Nov 26, 2013 at 12:26:49PM -0500, Nicolas Pitre wrote:
> On Tue, 26 Nov 2013, Russell King - ARM Linux wrote:
> 
> > On Tue, Nov 26, 2013 at 08:35:43AM -0500, Nicolas Pitre wrote:
> > > On Tue, 26 Nov 2013, Russell King - ARM Linux wrote:
> > > 
> > > > On Mon, Nov 25, 2013 at 10:56:25PM -0500, Nicolas Pitre wrote:
> > > > > What about simply doing the following instead, which I'm sure used to 
> > > > > work properly at some point:
> > > > > 
> > > > > diff --git a/arch/arm/include/asm/memory.h b/arch/arm/include/asm/memory.h
> > > > > index 9ecccc8650..2b8b8d3236 100644
> > > > > --- a/arch/arm/include/asm/memory.h
> > > > > +++ b/arch/arm/include/asm/memory.h
> > > > > @@ -239,6 +239,14 @@ static inline unsigned long __phys_to_virt(phys_addr_t x)
> > > > >  
> > > > >  #else
> > > > >  
> > > > > +#ifndef PHYS_OFFSET
> > > > > +#ifdef PLAT_PHYS_OFFSET
> > > > > +#define PHYS_OFFSET	PLAT_PHYS_OFFSET
> > > > > +#else
> > > > > +#define PHYS_OFFSET	UL(CONFIG_PHYS_OFFSET)
> > > > > +#endif
> > > > > +#endif
> > > > > +
> > > > >  static inline phys_addr_t __virt_to_phys(unsigned long x)
> > > > >  {
> > > > >  	return (phys_addr_t)x - PAGE_OFFSET + PHYS_OFFSET;
> > > > > @@ -253,14 +261,6 @@ static inline unsigned long __phys_to_virt(phys_addr_t x)
> > > > >  #endif
> > > > >  #endif /* __ASSEMBLY__ */
> > > > >  
> > > > > -#ifndef PHYS_OFFSET
> > > > > -#ifdef PLAT_PHYS_OFFSET
> > > > > -#define PHYS_OFFSET	PLAT_PHYS_OFFSET
> > > > > -#else
> > > > > -#define PHYS_OFFSET	UL(CONFIG_PHYS_OFFSET)
> > > > > -#endif
> > > > > -#endif
> > > > 
> > > > And that makes PHYS_OFFSET undefined to assembly code - and we have
> > > > references to it from said code.
> > > 
> > > Why does the kernel compile properly for me with this change then?
> > 
> > Nicolas,
> > 
> > Try using grep rather than just typing emails for the hell of it.
> > Try looking at the patch I sent to fix this issue.  Either of those
> > will give you the appropriate clue necessary to answer your question.
> 
> Your patch does s/PHYS_OFFSET/PLAT_PHYS_OFFSET/ in assembly code and 
> defines PLAT_PHYS_OFFSET with CONFIG_PHYS_OFFSET when needed.
> 
> Mine leaves PHYS_OFFSET as is in assembly code and defines PHYS_OFFSET 
> with PLAT_PHYS_OFFSET or CONFIG_PHYS_OFFSET as appropriate, as it *used* 
> to work before commit ca5a45c06c.

If manual inspection fails you, try building a nommu or XIP kernel.

For crying out loud, you're moving the definition of PHYS_OFFSET to be
_inside_ a #ifndef __ASSEMBLY__ .. #endif section.  That's fscking
obvious if you bother to read your own patch, because you move the
definition to just _before_ some C code, and the assembler won't
parse C code.

  reply	other threads:[~2013-11-26 17:36 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-25 22:36 Build breakage from 'ARM: mm: use phys_addr_t appropriately in p2v and v2p conversions' Jason Gunthorpe
2013-11-25 23:20 ` Russell King - ARM Linux
2013-11-25 23:34   ` Jason Gunthorpe
2013-11-25 23:39     ` Russell King - ARM Linux
2013-11-25 23:48       ` Santosh Shilimkar
2013-11-25 23:36   ` Russell King - ARM Linux
2013-11-26  3:56     ` Nicolas Pitre
2013-11-26  9:54       ` Russell King - ARM Linux
2013-11-26 13:35         ` Nicolas Pitre
2013-11-26 13:41           ` Russell King - ARM Linux
2013-11-26 17:26             ` Nicolas Pitre
2013-11-26 17:36               ` Russell King - ARM Linux [this message]
2013-11-26 18:41                 ` Nicolas Pitre
2013-11-26 19:25                   ` Russell King - ARM Linux
2013-11-26 20:08                     ` Nicolas Pitre
2013-12-10 19:17     ` Jason Gunthorpe
2013-12-10 19:43       ` Russell King - ARM Linux

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20131126173659.GE16735@n2100.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).