zephyr/subsys
Aurelien Jarno a169d90667 nvs: avoid reading multiple times the same area
The current NVS code checks for an empty ATE using th
_nvs_flash_cmp_const() function. This function loads the data and
compare them to a value. This means that when executed multiple on the
same area, the data get reloaded multiple time. This might have a
noticeable performance impact with an SPI flash.

Instead define a function _nvs_ate_cmp_const to compare an already read
struct nvs_ate with a constant value. Then replace the calls to
_nvs_flash_cmp_const() on struct nvs_ate by _nvs_flash_ate_rd() followed
by _nvs_ate_cmp_const(). This also has the advantage of explicitly
checking for errors instead of testing the error and the result of the
comparison at the same time.

Tested on a Nucleo L432KC board with the nvs sample. The maximum
initialization time (ie just before running the first garbage collector)
goes down to 6213 µs from 7350 µs.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2019-01-02 13:03:09 +01:00
..
app_memory
bluetooth
console
cpp
debug doc: regular misspelling scan 2018-12-26 13:27:14 -05:00
dfu samples: subsys: usb: dfu: Fix build error for intel_s1000 2018-12-30 16:24:33 -05:00
disk crc: Move crc7 into CRC single header 2018-12-30 16:24:10 -05:00
fb kconfig: Have the 'framebuffer' menu depend on it being enabled 2018-12-30 16:24:50 -05:00
fs nvs: avoid reading multiple times the same area 2019-01-02 13:03:09 +01:00
logging
mgmt
net doc: regular misspelling scan 2018-12-26 13:27:14 -05:00
power power: rename api sys_soc -> sys_ 2018-12-28 16:16:28 -05:00
random
settings
shell shell: Changing shell_history_get signature 2018-12-28 17:47:46 -05:00
stats
storage
usb usb: class: dfu: Add a worker thread to flash data from usb to flash 2018-12-30 16:24:33 -05:00
CMakeLists.txt
Kconfig