U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Tom Rini <trini@konsulko.com>
To: Heinrich Schuchardt <xypron.glpk@gmx.de>
Cc: Marek Vasut <marek.vasut+renesas@mailbox.org>,
	Jerome Forissier <jerome.forissier@linaro.org>,
	Simon Glass <sjg@chromium.org>,
	u-boot@lists.denx.de
Subject: Re: [PATCH v2 2/3] env: Add single to redundant environment upgrade path
Date: Tue, 23 Dec 2025 12:04:45 -0600	[thread overview]
Message-ID: <20251223180445.GE847766@bill-the-cat> (raw)
In-Reply-To: <ac80d9cd-4890-4382-9ce6-2f237933d32c@gmx.de>

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

On Tue, Dec 23, 2025 at 06:43:00PM +0100, Heinrich Schuchardt wrote:
> On 12/23/25 15:31, Marek Vasut wrote:
> > Add support for converting single-copy environment to redundant environment.
> > In case CRC checks on both redundant environment copies fail, try one more
> > CRC check on the primary environment copy and treat it as single environment.
> 
> Why would a CRC check suddenly succeed if it has failed before?
> 
> This needs some more explanation.
> 
> > If that check does pass, rewrite the single-copy environment into redundant
> > environment format, indicate the environment is valid, and import that as
> > usual primary copy of redundant environment. Follow up 'env save' will then
> > store two environment copies and the system will continue to operate as
> > regular redundant environment system.
> > 
> > Add test which validates this upgrade path. The test starts with spi.bin
> > which is pre-populated as single-copy environment and then upgrades that
> > environment to dual-copy environment.
> > 
> > Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
> > ---
> > Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
> > Cc: Jerome Forissier <jerome.forissier@linaro.org>
> > Cc: Simon Glass <sjg@chromium.org>
> > Cc: Tom Rini <trini@konsulko.com>
> > Cc: u-boot@lists.denx.de
> > ---
> > V2: - Gate the option behind ENV_REDUNDANT_UPGRADE
> >      - Fix up mkenvimage path in env test
> > ---
> >   env/Kconfig               | 11 ++++++
> >   env/common.c              | 31 +++++++++++++++-
> >   test/py/tests/test_env.py | 74 +++++++++++++++++++++++++++++++++++++++
> >   3 files changed, 115 insertions(+), 1 deletion(-)
> > 
> > diff --git a/env/Kconfig b/env/Kconfig
> > index 4430669964c..b312f9b5324 100644
> > --- a/env/Kconfig
> > +++ b/env/Kconfig
> > @@ -489,6 +489,17 @@ config ENV_REDUNDANT
> >   	  which is used by env import/export commands which are independent of
> >   	  storing variables to redundant location on a non volatile device.
> > +config ENV_REDUNDANT_UPGRADE
> > +	bool "Enable single-copy to redundant environment upgrade support"
> > +	depends on ENV_REDUNDANT
> > +	help
> > +	  Normally, redundant environment is expected to always operate on
> > +	  two copies of the environment. However, hardware that may have
> > +	  originally shipped with single-copy environment can be upgraded
> 
> %s/with single-copy/with a single-copy/
> %s/can be/that can be/
> 
> > +	  to redundant environment without loss of existing environment
> > +	  content by correctly configuring the location of the redundant
> > +	  environment copy and by enabling this option.
> 
> Why do we have to make this an option?
> Shouldn't we always try to restore the environment?

Because the use case here is (I believe) converting a platform which had
non-redundant environment to a functional redundant environment. Without
making this optional we get size growth on platforms which enable
redundant env today (see v1).

-- 
Tom

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

  reply	other threads:[~2025-12-23 18:04 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-23 14:31 [PATCH v2 1/3] test: env: Add test for environment storage in SPI NOR Marek Vasut
2025-12-23 14:31 ` [PATCH v2 2/3] env: Add single to redundant environment upgrade path Marek Vasut
2025-12-23 17:43   ` Heinrich Schuchardt
2025-12-23 18:04     ` Tom Rini [this message]
2025-12-23 18:53     ` Marek Vasut
2025-12-23 14:31 ` [PATCH v2 3/3] configs: sandbox: Enable environment in SPI NOR support Marek Vasut
2025-12-23 17:58   ` Heinrich Schuchardt
2025-12-23 18:07     ` Tom Rini
2025-12-23 17:32 ` [PATCH v2 1/3] test: env: Add test for environment storage in SPI NOR Heinrich Schuchardt
2025-12-23 18:55   ` Marek Vasut
2025-12-23 23:32     ` Tom Rini
2025-12-31 16:07       ` Marek Vasut
2025-12-31 16:11         ` Tom Rini
2025-12-31 16:50           ` Marek Vasut
2025-12-31 17:18             ` Tom Rini
2025-12-31 17:46               ` Marek Vasut
2025-12-24  3:18     ` Heinrich Schuchardt
2026-01-07 21:06 ` 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=20251223180445.GE847766@bill-the-cat \
    --to=trini@konsulko.com \
    --cc=jerome.forissier@linaro.org \
    --cc=marek.vasut+renesas@mailbox.org \
    --cc=sjg@chromium.org \
    --cc=u-boot@lists.denx.de \
    --cc=xypron.glpk@gmx.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