mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Nicolas Pitre <nicolas.pitre@linaro.org>
Cc: Paul Gortmaker <paul.gortmaker@windriver.com>,
	Russell King - ARM Linux <linux@arm.linux.org.uk>,
	linux-arm-kernel@lists.infradead.org,
	Arnd Bergmann <arnd@arndb.de>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] arm: add default value for PHYS_OFFSET Kconfig setting
Date: Fri, 2 Dec 2011 10:21:24 +0100	[thread overview]
Message-ID: <20111202092124.GR26618@pengutronix.de> (raw)
In-Reply-To: <alpine.LFD.2.02.1112020024370.2357@xanadu.home>

Hello Nicolas,

On Fri, Dec 02, 2011 at 12:33:26AM -0500, Nicolas Pitre wrote:
> On Fri, 2 Dec 2011, Nicolas Pitre wrote:
> 
> > On Thu, 1 Dec 2011, Paul Gortmaker wrote:
> > 
> > > On Thu, Dec 1, 2011 at 9:19 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> > > > On Thursday 01 December 2011, Paul Gortmaker wrote:
> > > >> Commit 1b9f95f8ade9efc2bd49f0e7b9dc61a038ac3eef introduced the new
> > > >> Kconfig for PHYS_OFFSET but it did not specify a default value.
> > > >>
> > > >> This has the undesired side effect of breaking an implictly used
> > > >> trick for updating defconfigs on the fly for routine buildtesting
> > > >> across all arch and all platforms, i.e.
> > > >>
> > > >>   cp /path/to/somedefconfig .config ; yes "" | make oldconfig
> > > >>
> > > >
> > > > FWIW, a better way to achieve the above is using
> > > >
> > > > make KCONFIG_ALLCONFIG=/path/to/somedefconfig listnewconfig alldefconfig
> > > >
> > > > which does not have this problem.
> > > >
> > > > Your patch looks still ok, but you might want to update your scripts
> > > > to be more robust.
> > > 
> > > Thanks -- but on the other hand, the above use case does actually
> > > emulate exactly what happens when someone runs the
> > > "make oldconfig" and simply holds down the Enter key. (yes it
> > > happens probably way more than we want to know...)
> > > 
> > > So, I guess what I'm trying to say is that the above "script" is
> > > intentionally fragile.  :)  As a use case, we shouldn't break it.
> > 
> > Well... I took a while before replying because I'm also modifying things 
> > around this, but those changes are good for a merge window not a -rc 
> > period.
> > 
> > Still, I don't think your patch is good, even as a temporary measure.  
> > The fact is that we can't just pick a random default value since it is 
> > likely to be wrong for the majority of the boards as the right answer 
> > for this option is quite varied.  So the fact that the config system 
> > insists on your entering a proper value is actually a good thing.
> > 
> > In the at91x40_defconfig case, it has CONFIG_EMBEDDED=y.  If it was not 
> > selected then you'd get CONFIG_ARM_PATCH_PHYS_VIRT=y by default and then 
> > no CONFIG_PHYS_OFFSET would be presented.
> > 
> > So the right fix here would actually consist of adding to 
> > at91x40_defconfig either CONFIG_ARM_PATCH_PHYS_VIRT=y, or a default 
> > value for CONFIG_PHYS_OFFSET which is the right value for that platform.
> 
> And it seems that at91x40 is the only defconfig with MMU=n, so the only 
> option is really to provide a default CONFIG_PHYS_OFFSET.  So what about 
> this:
> 
> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> index e084b7e981..a24672924f 100644
> --- a/arch/arm/Kconfig
> +++ b/arch/arm/Kconfig
> @@ -222,6 +222,7 @@ config NEED_MACH_MEMORY_H
>  config PHYS_OFFSET
>  	hex "Physical address of main memory"
>  	depends on !ARM_PATCH_PHYS_VIRT && !NEED_MACH_MEMORY_H
> +	default DRAM_BASE if !MMU
>  	help
>  	  Please provide the physical address corresponding to the
>  	  location of main memory in your system.
> 
> Eventually the DRAM_BASE config option could simply be replaced by 
> PHYS_OFFSET directly, but that's a larger change.
I'm working on a MMU-less machine, too and had that change already in my
working copy. I was about to commit and it send out later today.

So: Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

  reply	other threads:[~2011-12-02  9:21 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-01  3:52 Paul Gortmaker
2011-12-01 10:52 ` Sergei Shtylyov
2011-12-01 14:19 ` Arnd Bergmann
2011-12-02  4:38   ` Paul Gortmaker
2011-12-02  5:19     ` Nicolas Pitre
2011-12-02  5:33       ` Nicolas Pitre
2011-12-02  9:21         ` Uwe Kleine-König [this message]
2011-12-02 16:31           ` Paul Gortmaker
2011-12-02 19:07             ` Uwe Kleine-König
2011-12-02 19:27               ` Nicolas Pitre
2011-12-02 20:23                 ` [PATCH] ARM: determine PHYS_OFFSET automatically for no-mmu configs Uwe Kleine-König
2011-12-02 22:19                   ` Nicolas Pitre

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=20111202092124.GR26618@pengutronix.de \
    --to=u.kleine-koenig@pengutronix.de \
    --cc=arnd@arndb.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=nicolas.pitre@linaro.org \
    --cc=paul.gortmaker@windriver.com \
    /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

Powered by JetHome