Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drivers/flash: deprecation of flash_write_protection_set() API #33216

Merged

Conversation

nvlsianpu
Copy link
Collaborator

@nvlsianpu nvlsianpu commented Mar 10, 2021

The API is deprecated as it was decided to build in the flash protection
service into write and erase procedures.
This is solution chosen for fix following issue:
When two or more threads writes to flash device it is
possible that flash protection will be enabled by one of
threads despite another thread(s) still needs it disabled.

fixes #31217

  • spi_flash_at45 (already ready)
  • soc_flash_nrf (already ready)
  • nrf_qspi_nor
  • spi_nor
  • soc_flash_lpc
  • soc_flash_mcux
  • soc_flash_rv32m1
  • soc_flash_nios2_qspi
  • flash_esp32 (already ready)
  • flash_gecko
  • flash_mcux_flexspi_nor (already ready)
  • flash_sam
  • flash_sam0
  • flash_stm32_qspi
  • flash_stm32
  • flash_stm32h7
  • flash_simulator
  • remove CONFIG_FLASH_SIMULATOR_ERASE_PROTECT (not relevant anymore)
  • align tests
  • removed usage in tests
  • removed usage in samples
  • remove usage in drivers, subsystems and wherever else

Additionally:
fs/nvs:
Removed two unneeded if statements. These statements had not
effect in function results.

Signed-off-by: Andrzej Puzdrowski [email protected]

@nvlsianpu nvlsianpu force-pushed the deprecate_flash_protecton_API branch 4 times, most recently from 111d10e to fd63bfe Compare March 12, 2021 12:52
@github-actions github-actions bot added platform: Silabs Silicon Labs platform: STM32 ST Micro STM32 labels Mar 12, 2021
@nvlsianpu nvlsianpu added the platform: nRF Nordic nRFx label Mar 12, 2021
@nvlsianpu nvlsianpu force-pushed the deprecate_flash_protecton_API branch from ed3f223 to 85f289d Compare March 12, 2021 17:06
@github-actions github-actions bot added the area: API Changes to public APIs label Mar 12, 2021
@nvlsianpu nvlsianpu force-pushed the deprecate_flash_protecton_API branch from 85f289d to b203ca3 Compare March 12, 2021 17:19
@nvlsianpu nvlsianpu changed the title drivers/flash/nrf_qspi_nor: integrate protection service into write/e… drivers/flash: deprecation of flash_write_protection_set() API Mar 12, 2021
@nvlsianpu nvlsianpu added area: Drivers area: Flash area: API Changes to public APIs and removed area: API Changes to public APIs labels Mar 12, 2021
@github-actions github-actions bot added the area: Tests Issues related to a particular existing or missing test label Mar 16, 2021
@nvlsianpu nvlsianpu force-pushed the deprecate_flash_protecton_API branch 3 times, most recently from eda53bf to 5a3c6fc Compare March 16, 2021 14:23
@nvlsianpu nvlsianpu added this to the v2.6.0 milestone Mar 16, 2021
@nvlsianpu nvlsianpu force-pushed the deprecate_flash_protecton_API branch from 5a3c6fc to f74a259 Compare March 16, 2021 14:52
@github-actions github-actions bot added area: Documentation Release Notes To be mentioned in the release notes labels Mar 16, 2021
@nvlsianpu nvlsianpu marked this pull request as ready for review March 16, 2021 14:55
Flash write protection services were integrated into erase and write
procedures. This is step required for fixing following issue:
Multi-threading flash access is not supported by
flash_write_protection_set().

flash_write_protection_set() will be deprecated

Signed-off-by: Andrzej Puzdrowski <[email protected]>
Flash write protection services were integrated into erase and write
procedures. This is step required for fixing following issue:
Multi-threading flash access is not supported by
flash_write_protection_set().

flash_write_protection_set() will be deprecated

Signed-off-by: Andrzej Puzdrowski <[email protected]>
Flash write protection services were integrated into erase and write
procedures. This is step required for fixing following issue:
Multi-threading flash access is not supported by
flash_write_protection_set().

flash_write_protection_set() will be deprecated

Signed-off-by: Andrzej Puzdrowski <[email protected]>
Flash write protection services were integrated into erase and write
procedures. This is step required for fixing following issue:
Multi-threading flash access is not supported by
flash_write_protection_set().

flash_write_protection_set() will be deprecated

Signed-off-by: Andrzej Puzdrowski <[email protected]>
…rase

Flash write protection services were integrated into erase and write
procedures. This is step required for fixing following issue:
Multi-threading flash access is not supported by
flash_write_protection_set().

flash_write_protection_set() will be deprecated

Signed-off-by: Andrzej Puzdrowski <[email protected]>
Flash write protection services were integrated into erase and write
procedures. This is step required for fixing following issue:
Multi-threading flash access is not supported by
flash_write_protection_set().

flash_write_protection_set() will be deprecated

As CONFIG_FLASH_SIMULATOR_ERASE_PROTECT become a dead option.
this commit removes it as well.

Signed-off-by: Andrzej Puzdrowski <[email protected]>
Made write_protection handler not mandatory.
flash_write_protection_set() becomes no-operation.
If write_protection handler is provided by the driver implementation
it will be called within flash_writ() and flash_erase().

Signed-off-by: Andrzej Puzdrowski <[email protected]>
flash_write_protection_set() API was deprecated so driver
implementation interface is left behind as well.

This patch removes all implementation pointed by the interface
'struct flash_driver_api.write_protection'.

Signed-off-by: Andrzej Puzdrowski <[email protected]>
flash_write_protection_set() was deprecated.
This patch removes usage of it and the test case which was
testing deprecated API behaviors.

Signed-off-by: Andrzej Puzdrowski <[email protected]>
…sage

This patch removes scenario which was testing deprecated
API behaviors. Needed as As flash_write_protection_set() was
deprecated and became no-operation.

Signed-off-by: Andrzej Puzdrowski <[email protected]>
flash_write_protection_set() was deprecated.
This patch removes usage of it.

Signed-off-by: Andrzej Puzdrowski <[email protected]>
flash_write_protection_set() was deprecated.
This patch removes usage of it and the test case which was
testing deprecated API behaviors.

Signed-off-by: Andrzej Puzdrowski <[email protected]>
Removed two unneeded `if` statements. These statements had not
effect in function results.

Signed-off-by: Andrzej Puzdrowski <[email protected]>
This patch removes scenario which was testing deprecated
API behaviors. Needed as As flash_write_protection_set() was
deprecated and became no-operation.

Signed-off-by: Andrzej Puzdrowski <[email protected]>
This patch removes scenario which was testing deprecated
API behaviors. Needed as As flash_write_protection_set() was
deprecated and became no-operation.

Signed-off-by: Andrzej Puzdrowski <[email protected]>
This patch removes scenario which was testing deprecated
API behaviors. Needed as As flash_write_protection_set() was
deprecated and became no-operation.

Signed-off-by: Andrzej Puzdrowski <[email protected]>
…sage

This patch removes scenario which was testing deprecated
API behaviors. Needed as As flash_write_protection_set() was
deprecated and became no-operation.

Signed-off-by: Andrzej Puzdrowski <[email protected]>
This patch removes scenario which was testing deprecated
API behaviors. Needed as As flash_write_protection_set() was
deprecated and became no-operation.

Signed-off-by: Andrzej Puzdrowski <[email protected]>
The API is deprecated as it was decided to build in the flash protection
service into write and erase procedures.
This is solution chosen for fix following issue:
  When two or more threads writes to flash device it is
  possible that flash protection will be enabled by one of
  threads despite another thread(s) still needs it disabled.

fixes zephyrproject-rtos#3127

Signed-off-by: Andrzej Puzdrowski <[email protected]>
Added note on deprecation of the API and description of flash
drivers changes.

Signed-off-by: Andrzej Puzdrowski <[email protected]>
Added integration_platforms with nrf52840dk_nrf52840.

Signed-off-by: Andrzej Puzdrowski <[email protected]>
This driver file couldn't be compiled due the syntax error.

Signed-off-by: Andrzej Puzdrowski <[email protected]>
@nashif nashif merged commit 6acc4a2 into zephyrproject-rtos:master Mar 29, 2021
trond-snekvik added a commit to trond-snekvik/fw-nrfconnect-nrf that referenced this pull request Apr 28, 2021
Flash write protection is now handled automatically inside the flash
write and erase functions, and flash_write_protection_set is deprecated.
See zephyrproject-rtos/zephyr#33216 for details.

Signed-off-by: Trond Einar Snekvik <[email protected]>
trond-snekvik added a commit to trond-snekvik/fw-nrfconnect-nrf that referenced this pull request Apr 30, 2021
Flash write protection is now handled automatically inside the flash
write and erase functions, and flash_write_protection_set is deprecated.
See zephyrproject-rtos/zephyr#33216 for details.

Signed-off-by: Trond Einar Snekvik <[email protected]>
carlescufi pushed a commit to nrfconnect/sdk-nrf that referenced this pull request Apr 30, 2021
Flash write protection is now handled automatically inside the flash
write and erase functions, and flash_write_protection_set is deprecated.
See zephyrproject-rtos/zephyr#33216 for details.

Signed-off-by: Trond Einar Snekvik <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: API Changes to public APIs area: Disk Access area: Documentation area: Drivers area: EEPROM area: File System area: Flash area: Samples Samples area: Settings Settings subsystem area: Shell Shell subsystem area: Storage Storage subsystem area: Tests Issues related to a particular existing or missing test platform: ESP32 Espressif ESP32 platform: nRF Nordic nRFx platform: NXP NXP platform: Silabs Silicon Labs platform: STM32 ST Micro STM32 Release Notes To be mentioned in the release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Multi-threading flash access is not supported by flash_write_protection_set()
9 participants