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

periph/flashpage: deprecate *_free functions #17860

Merged
merged 2 commits into from
Mar 31, 2022

Conversation

Ollrogge
Copy link
Member

Contribution description

The functions flashpage_first_free and flashpage_last_free added with #16972 were introduced to avoid overwriting and therefore corrupting firmware / bootloaders when writing to flash memory. These functions have the flaw that if multiple modules simultaneously use them they will not be aware of each other. E.g. flashpage_first_free will return the same value for all modules and can therefore lead to the modules corrupting each others data by writing to the same flashpage.

With #17436 being merged a new and better mechanism has been introduced that achieves the same goal as #16972 but without the flaws. It enables the reservation of flash memory at compile time and ensures that no data is corrupted. Furthermore multiple modules can use this mechanism simultaneously. Based on this the flashpage_*_free functions are no longer needed and can be deprecated.

I have never deprecated anything, therefore I need some help of what I need to to. Thanks !

@Ollrogge Ollrogge requested a review from MrKevinWeiss as a code owner March 24, 2022 17:46
@github-actions github-actions bot added the Area: drivers Area: Device drivers label Mar 24, 2022
@Ollrogge
Copy link
Member Author

@chrysn could you give me some pointers here ?

@chrysn
Copy link
Member

chrysn commented Mar 29, 2022

Deprecation notes should always tell why something is deprecated, and what to do instead (as in the suggestion; the "why" doesn't need to be fully explicit). Unless something was introduced only after the latest release anyway, we generally keep a deprecation period of one release, meaning that (if this gets merged fast, which it will) the deprecation notice will stay in until the 2022.04 release, after which a follow-up PR can reap the deprecation and remove the code. (It doesn't need to happen immediately, nobody will complain if it stays longer, but at least there should be one release in which a stable-to-stable upgrader can see that this is deprecated now, migrate inside that release, and get code that'll work on the next release as well).

@chrysn chrysn added the Process: deprecation Integration Process: The PR is deprecating a feature or API label Mar 29, 2022
@Ollrogge Ollrogge force-pushed the deprecate_flashpage branch from ea52da4 to c0083ed Compare March 31, 2022 10:07
@Ollrogge
Copy link
Member Author

Added your suggestions. Thanks for the help and explanation of the process :)

@chrysn chrysn added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Mar 31, 2022
@chrysn chrysn enabled auto-merge March 31, 2022 10:09
@chrysn
Copy link
Member

chrysn commented Mar 31, 2022

Thanks, looking good. ACKed, flags set, and unless something hickups this should be merged whenever CI gets around to having a look at it.

auto-merge was automatically disabled March 31, 2022 10:38

Head branch was pushed to by a user without write access

@Ollrogge Ollrogge force-pushed the deprecate_flashpage branch from c0083ed to 1bcbac5 Compare March 31, 2022 10:38
@Ollrogge
Copy link
Member Author

I guess @ref doesn't work for macros so I removed it

@chrysn
Copy link
Member

chrysn commented Mar 31, 2022

It does, but the documentation of FLASH_WRITABLE_INIT is not built because it is conditional on a module; the condition should be similar to here, note that #ifdef needs to become #if defined() then. Could you restore the @ref version and activate the documentation in a separate commit?

@Ollrogge Ollrogge force-pushed the deprecate_flashpage branch from 1bcbac5 to 4974790 Compare March 31, 2022 15:01
@chrysn chrysn enabled auto-merge March 31, 2022 15:08
@chrysn
Copy link
Member

chrysn commented Mar 31, 2022

Renders fine now. Thank you! Should be auto-merged soon.

@chrysn chrysn merged commit 5221ce2 into RIOT-OS:master Mar 31, 2022
@OlegHahm OlegHahm added this to the Release 2022.04 milestone Apr 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: drivers Area: Device drivers CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Process: deprecation Integration Process: The PR is deprecating a feature or API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants