public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Tom Rini <trini@konsulko.com>
To: "Pali Rohár" <pali@kernel.org>
Cc: Troy Kisky <troy.kisky@boundarydevices.com>,
	Joe Hershberger <joe.hershberger@ni.com>,
	Wolfgang Denk <wd@denx.de>, Simon Glass <sjg@chromium.org>,
	u-boot@lists.denx.de
Subject: Re: [PATCH 2/2] Nokia RX-51: Remove CONFIG_PREBOOT from defconfig
Date: Wed, 27 Jul 2022 15:08:05 -0400	[thread overview]
Message-ID: <20220727190805.GC1146598@bill-the-cat> (raw)
In-Reply-To: <20220727190115.mdioeacusmgpwgbd@pali>

[-- Attachment #1: Type: text/plain, Size: 3215 bytes --]

On Wed, Jul 27, 2022 at 09:01:15PM +0200, Pali Rohár wrote:
> On Wednesday 27 July 2022 14:58:20 Tom Rini wrote:
> > On Wed, Jul 27, 2022 at 08:52:01PM +0200, Pali Rohár wrote:
> > > On Wednesday 27 July 2022 14:48:23 Tom Rini wrote:
> > > > On Wed, Jul 27, 2022 at 08:34:41PM +0200, Pali Rohár wrote:
> > > > > On Monday 25 July 2022 17:21:00 Tom Rini wrote:
> > > > > > On Sun, Jul 10, 2022 at 01:42:56PM +0200, Pali Rohár wrote:
> > > > > > 
> > > > > > > CONFIG_PREBOOT just cause putting "preboot=CONFIG_PREBOOT" into env list.
> > > > > > > Value CONFIG_PREBOOT="run preboot" in defconfig is just nonsense and does
> > > > > > > not do anything useful (it is infinite recursion). Config file for this
> > > > > > > board already contains default preboot= env variable with correct value,
> > > > > > > which has higher priority than CONFIG_PREBOOT and this is reason why
> > > > > > > nonsense CONFIG_PREBOOT is ignored.
> > > > > > > 
> > > > > > > Remove nonsense and unused CONFIG_PREBOOT from nokia_rx51_defconfig file.
> > > > > > > 
> > > > > > > Signed-off-by: Pali Rohár <pali@kernel.org>
> > > > > > 
> > > > > > Applied to u-boot/master, thanks!
> > > > > 
> > > > > Patch 1/2 is missing.
> > > > 
> > > > Sorry if I was unclear enough in the rest of the emails, I'm not
> > > > applying 1/2.  The empty string is fine enough (again, other variables
> > > > have this issue).  Unless I missed something and there's a run-time
> > > > failure that 1/2 resolves?
> > > 
> > > The issue is that preboot= variable is defined in ENV array two times.
> > > Once in Kconfig and second time in regular environment define.
> > > 
> > > It is just coincidence that the definition from Kconfig is ignored
> > > because currently it is put _after_ the regular preboot= definition. But
> > > this is fragile and probably some unrelated change/patch could change
> > > this behavior.
> > > 
> > > We really do not want two preboot= definitions in ENV array and pray
> > > that the correct one would be used by U-Boot at runtime.
> > 
> > It's not coincidence, it's down to link order.  So it's not going to
> > break anytime soon.  And it's not just preboot that's in this situation.
> 
> It is not linker order, but rather order in which are specified
> preprocessor macros...

Ah right, sorry, I was thinking of something else I found when doing
CONFIG_EXTRA_ENV_TEXT / CONFIG_EXTRA_ENV_SETTINGS stuff.

> And what else is in the same situation as preboot? I just do not see
> other variable which is defined two times.

Right so it's all from include/env_default.h yes?  CONFIG_EXTRA_ENV_TEXT
and then CONFIG_EXTRA_ENV_SETTINGS win.  And pretty much everything else
in that file that has a CONFIG knob to it either has a different bit of
Kconfig "fun" to avoid the situation PREBOOT has or is already in the
same boat.

> > A more generic approach to deal with this would be appreciated.

Which is why I said this.  How we're doing this right now isn't great
and isn't super user friendly.  I don't want to have to repeat the logic
you do in 1/2 for all of the CONFIG options in env_default.h that aren't
already converted to Kconfig.

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

  reply	other threads:[~2022-07-27 19:08 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-10 11:42 [PATCH 1/2] Fix usage of CONFIG_PREBOOT Pali Rohár
2022-07-10 11:42 ` [PATCH 2/2] Nokia RX-51: Remove CONFIG_PREBOOT from defconfig Pali Rohár
2022-07-11 23:23   ` Tom Rini
2022-07-12  8:11     ` Pali Rohár
2022-07-12 21:39       ` Tom Rini
2022-07-12 21:52         ` Pali Rohár
2022-07-12 22:58           ` Tom Rini
2022-07-12 23:11             ` Pali Rohár
2022-07-12 23:15               ` Tom Rini
2022-07-13  8:36                 ` Pali Rohár
2022-07-25 21:21   ` Tom Rini
2022-07-27 18:34     ` Pali Rohár
2022-07-27 18:48       ` Tom Rini
2022-07-27 18:52         ` Pali Rohár
2022-07-27 18:58           ` Tom Rini
2022-07-27 19:01             ` Pali Rohár
2022-07-27 19:08               ` Tom Rini [this message]
2022-10-09 13:03                 ` Pali Rohár
2022-11-01 22:58                   ` Pali Rohár
2022-11-01 23:29                     ` Tom Rini
2022-11-20 16:37                       ` Pali Rohár
2022-07-12 10:58 ` [PATCH 1/2] Fix usage of CONFIG_PREBOOT Simon Glass
2022-07-12 11:18   ` Pali Rohár
2022-11-21 17:33 ` Tom Rini

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=20220727190805.GC1146598@bill-the-cat \
    --to=trini@konsulko.com \
    --cc=joe.hershberger@ni.com \
    --cc=pali@kernel.org \
    --cc=sjg@chromium.org \
    --cc=troy.kisky@boundarydevices.com \
    --cc=u-boot@lists.denx.de \
    --cc=wd@denx.de \
    /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