
Hello Horatiu,
Am 14.03.2019 um 13:53 schrieb Horatiu Vultur:
Hi Heiko,
I managed to reproduce the issue that you described.
Fine, thanks for testing!
Don't you think it is a little bit too harsh to remove the commit completely?
I am unsure here ...
I am not sure but how many cases are where UBoot doesn't store anything in flash? And then lets the linux to update the flash.
I think that can happen very often. In my case for example we boot SPL/U-Boot with usb loader, than an initsystem with kernel/dtb/ramdisk and start swupdate for installing all sources (including setup the Environment with fw_setenv)...
Or is wouldn't better to update fw_setenv to set the entire flash to 0x0 when it detects that the CRC error? The same way how the saveenv it is doing in UBoot?
Indeed, just reproduced this on my board. Saving the Environment with saveenv fills with 0x0 and saving with fw_setenv fills with 0xff.
This is no problem, until your optimization, and I think, we cannot change this here without breaking a lot of boards, running fine.
I am here also on Stefanos side always to read the hole Environment space, because we cannot be sure, with what the empty space is filled up.
Back to your intention for this patch, stated in the commit message: """ This is an optimization for large environments that contain few bytes environment variables. In this case it doesn't need to read the entire environment and only few pages. """
Hmm... why you use a big Environment, if you only have "few bytes" of variables ?
Simply set CONFIG_ENV_SIZE to a smaller value than your CONFIG_ENV_SECT_SIZE
Is this not possible for you ?
bye, Heiko