-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Conversation
@chrysn could you give me some pointers here ? |
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). |
ea52da4
to
c0083ed
Compare
Added your suggestions. Thanks for the help and explanation of the process :) |
Thanks, looking good. ACKed, flags set, and unless something hickups this should be merged whenever CI gets around to having a look at it. |
Head branch was pushed to by a user without write access
c0083ed
to
1bcbac5
Compare
I guess @ref doesn't work for macros so I removed it |
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 |
1bcbac5
to
4974790
Compare
Renders fine now. Thank you! Should be auto-merged soon. |
Contribution description
The functions
flashpage_first_free
andflashpage_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 !