-
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
mtd/*: drop .write() if .write_page() is implemented #15380
Conversation
Do you an idea how test this without owning the respective hardware? Or can we prove that |
I don't think we have to test this on every implementation, the functionality is the same everywhere. I didn't do any tests yet, this is more a PoC, but the idea is to only have one write implementation per MTD backend. |
Please rebase! |
3b4abfa
to
7dbbc69
Compare
7dbbc69
to
ae482d1
Compare
ae482d1
to
0531d40
Compare
rebased |
Any blockers for this, does it just need some testing? |
Las tcomment sated this was a PoC, is this still the case? |
If |
Do you have a test procedure for this? |
I only worry that eventually, some external code could be relying on this function, so at least it needs to be tagged as removal. We could also conditionally include (with a pseudo module) and then remove it in a release or two, but maybe it's not worth the effort. Let's just make sure it will be tagged in release notes. |
tryBuild succeeded: |
The old .write() function is only used as a fall-back if .write_page() is not implemented. We can drop it.
The old .write() function is only used as a fall-back if .write_page() is not implemented. We can drop it.
The old .write() function is only used as a fall-back if .write_page() is not implemented. We can drop it.
The old .write() function is only used as a fall-back if .write_page() is not implemented. We can drop it.
The old .write() function is only used as a fall-back if .write_page() is not implemented. We can drop it.
The MTD layer now takes care of splitting up writes, so it should always work (as long as the destination address is within the memory region)
3f358ca
to
9dcf47d
Compare
9dcf47d
to
82cf5f3
Compare
All MTD drivers should now implement the .write_page() function instead.
82cf5f3
to
9855b02
Compare
All backends are tested now, the virtual backends are tested by CI. |
Thank you! 😃 |
Contribution description
The old
.write()
function is only used as a fall-back if.write_page()
is not implemented.We can drop it.
Testing procedure
Everything will fall back to
.write_page
now, so no user visible change.On the driver level,
.write_page
can be much simpler than.write
as all the common logic is handled by MTD and we can do partial writes (only write to page boundary, MTD will split up the transaction).native
(tested by CI)AT25xxx
tests/mtd_raw
ESP32
tests/mtd_raw
MTD SDcard
tests/mtd_raw
MTD spi_nor, at24mac, MTD SDMMC (with #20180)
tests/mtd_raw
Issues/PRs references
includes #15378
probably also needs #14953 and #19258