-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Fix functionality for FlashIAPBD & SlicingBD #10108
Conversation
Due to discovery of inconsistent sector sizes in devices storage the is_valid_erase function was adjusted, For FlashIAPBD the 'code size' was included to the calculation, preventing faulty "virtual" addresses calculation. For SlicingBD the same error was fixed and in all 3 validation functions that sent addresses for validation and program/read/erase different addresses.
@theamirocohen, thank you for your changes. |
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.
LGTM.
This is a fix adding new functionality, marked for 5.13rc1 |
Hi @0xc0170, this pull request doesn't add new functionality, it just implement class functions. |
@0xc0170, this is definitely a bug fix. The FlashIAP and Slicing block devices currently use wrong logic to decide whether the input parameters for erase/read/write APIs are valid or not. This PR fixes that logic. |
Thanks for the details! @dannybenor Please approve and confirm the intention having this in the patch release. |
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.
Waiting for @dannybenor approval
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.
Should go to a patch of 5.12
@@ -256,4 +256,13 @@ const char *FlashIAPBlockDevice::get_type() const | |||
return "FLASHIAP"; | |||
} | |||
|
|||
bool FlashIAPBlockDevice::is_valid_erase(bd_addr_t addr, bd_size_t size) const | |||
{ | |||
bd_addr_t base_addr = addr + (_base - _flash.get_flash_start()); |
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.
Please add a comment saying what is base_addr and that it is related to the full flash, not only the addresses inside the blockdevice
CI started. Would like to see this come into RC3 is possible (@ARmmbed/mbed-os-maintainers) |
Test run: SUCCESSSummary: 13 of 13 test jobs passed |
Description
Due to discovery of inconsistent sector sizes in devices storage the is_valid_erase function was adjusted,
For FlashIAPBD the 'code size' was included to the calculation, preventing faulty "virtual" addresses calculation.
For SlicingBD the same error was fixed and in all 3 validation functions that sent addresses for validation and program/read/erase different addresses.
Pull request type
Reviewers
@ARMmbed/mbed-os-storage
@geky