-
Notifications
You must be signed in to change notification settings - Fork 95
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
feat(spi_nand_flash): Add Kconfig option to verify write operations #436
feat(spi_nand_flash): Add Kconfig option to verify write operations #436
Conversation
f4d2a95
to
0ac8c3c
Compare
be53084
to
01fe332
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR @RathiSonika.
I left a few minor comments. The major one is whether we should indeed verify writes above Dhara layer, like you did, or below it, in nand.c dhara_glue.c.
To me it seems that verifying writes at lower layer achieves the goal of making sure our Flash operations work correctly, while verifying at upper layer doesn't.
We do writes to Flash in dhara_nand_prog, dhara_nand_copy, dhara_nand_mark_bad. If we fail to perform the write in dhara_nand_mark_bad correctly, we might not get the verification error in spi_nand_flash_write_sector
. Dhara will consider the page as "bad" until next reset, but after reset we will mistakenly detect the page as not "bad" because the bad block marker wasn't written correctly.
I had the same thought to add it in below Dhara layer. Currently added it to nand.c. I wasn’t entirely sure if it should go in dhara_glue.c, given its tight coupling with the Dhara library. However, you’re right; we should verify the write operation below Dhara layer. So, for the current structure, it makes sense to add this in dhara_glue.c. We could consider refactoring this in the future. |
a7220f2
to
33f6ef4
Compare
33f6ef4
to
4e8026d
Compare
4e8026d
to
794a352
Compare
794a352
to
c45d3aa
Compare
Change description
spi_nand_flash_copy_sector()
API in nand.c and test case for the same.