From: Benjamin ROBIN <benjamin.robin@bootlin.com>
To: U-Boot Mailing List <u-boot@lists.denx.de>,
Adrian Freihofer <adrian.freihofer@siemens.com>,
Heiko Schocher <hs@nabladev.com>
Cc: Benjamin ROBIN <dev@benjarobin.fr>,
Jerome Forissier <jerome@forissier.org>,
Joe Hershberger <joe.hershberger@ni.com>,
Marek Vasut <marek.vasut+renesas@mailbox.org>,
Quentin Schulz <quentin.schulz@cherry.de>,
Tom Rini <trini@konsulko.com>
Subject: Re: [PATCH v1] env: add w flags for net config in explicit write mode
Date: Sun, 25 Jan 2026 14:33:22 +0100 [thread overview]
Message-ID: <8634622.T7Z3S40VBb@brobin-bootlin> (raw)
In-Reply-To: <31984d37-7857-f6f1-fe58-96d064d45019@nabladev.com>
Hello Heiko,
On Sunday, January 25, 2026 at 2:03 PM, Heiko Schocher wrote:
> > Users who enable CONFIG_ENV_WRITEABLE_LIST typically want full control
> > over
> > which environment variables are writable. The new default behavior
> > introduced by your patch might not align with what all users expect or
> > want.
> >
> > Would overriding the flags using CFG_ENV_FLAGS_LIST_STATIC not work in
> > this
> > case?
>
> Good question, I have to test... or may Adrian has already done
> such tests...
Please test.
> But looking into code.. if we add this variables in ENV_WRITEABLE_LIST
> the results would be, that this variables are twice in ENV_FLAGS_LIST_STATIC
>
> include/env_flags.h
> 87 #define ENV_FLAGS_LIST_STATIC \
> 88 ETHADDR_FLAGS \
> 89 NET_FLAGS \
> 90 NET6_FLAGS \
> 91 SERIAL_FLAGS \
> 92 CFG_ENV_FLAGS_LIST_STATIC
>
> once through NET_FLAGS and once through CFG_ENV_FLAGS_LIST_STATIC
Yes, the variables with the flags would be declared twice.
> So, that is not good, and I think, code will find the first
> entry, and parse it -> so it will not work.
What leads you to this assumption?
If you examine the code, you'll notice that:
- The env_attr_lookup() function returns the last entry.
- When iterating over the flags using env_attr_walk(), any previous attribute
flags are overridden by subsequent flag declarations.
> Should we instead in case CONFIG_ENV_WRITEABLE_LIST is enabled
> only set/allow CFG_ENV_FLAGS_LIST_STATIC in ENV_FLAGS_LIST_STATIC ?
I haven't tested this myself, as I currently don't have a test environment
available. Please test it, and if it doesn't work, the correct fix would be to
ensure that any future flag declaration overrides previous ones.
--
Benjamin Robin, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
next prev parent reply other threads:[~2026-01-25 13:33 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-24 5:40 [PATCH v1] env: add w flags for net config in explicit write mode Heiko Schocher
2026-01-24 11:35 ` Benjamin ROBIN
2026-01-25 13:03 ` Heiko Schocher
2026-01-25 13:33 ` Benjamin ROBIN [this message]
2026-01-25 13:40 ` Heiko Schocher
2026-01-26 13:25 ` Heiko Schocher
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=8634622.T7Z3S40VBb@brobin-bootlin \
--to=benjamin.robin@bootlin.com \
--cc=adrian.freihofer@siemens.com \
--cc=dev@benjarobin.fr \
--cc=hs@nabladev.com \
--cc=jerome@forissier.org \
--cc=joe.hershberger@ni.com \
--cc=marek.vasut+renesas@mailbox.org \
--cc=quentin.schulz@cherry.de \
--cc=trini@konsulko.com \
--cc=u-boot@lists.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 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.