[PATCH] env: Invert gd->env_valid for env_mmc_save
    Tom Rini 
    trini at konsulko.com
       
    Tue Oct 21 22:36:50 CEST 2025
    
    
  
On Fri, May 10, 2024 at 01:38:34PM +0200, jasper at fancydomain.eu wrote:
> From: Jasper Orschulko <jasper at fancydomain.eu>
> 
> The A/B update strategy of the env's has a gap in the first 2 calls of saveenv.
> The env's are stored twice on the first memory area if:
> gd->env_valid == ENV_INVALID.
> 
> u-boot=> saveenv
> Saving Environment to MMC... Writing to MMC(1)... OK
> u-boot=> saveenv
> Saving Environment to MMC... Writing to MMC(1)... OK  <-- !!!
> u-boot=> saveenv
> Saving Environment to MMC... Writing to redundant MMC(1)... OK
> u-boot=> saveenv
> Saving Environment to MMC... Writing to MMC(1)... OK
> 
> Signed-off-by: Michael Glembotzki <Michael.Glembotzki at iris-sensing.com>
> Signed-off-by: Jasper Orschulko <jasper at fancydomain.eu>
Sorry for the extreme delay here. I was hoping for more feedback from
others and then it slipped my mind. And then we had a long thread
addressing this same problem for env/sf.c. So I've applied this now
(with a slight reword to note the env/sf.c fix) and posted a patch to
address env/fat.c and env/ubi.c.
Applied to u-boot/master, thanks!
-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20251021/7e470a8f/attachment.sig>
    
    
More information about the U-Boot
mailing list