[M] Change in flashrom[main]: Fix FEATURE_NO_ERASE chips and add test for them
Attention is currently required from: Miklós Márton, Peter Marheine. Anastasia Klimchuk has posted comments on this change by Anastasia Klimchuk. ( https://review.coreboot.org/c/flashrom/+/84203?usp=email ) Change subject: Fix FEATURE_NO_ERASE chips and add test for them ...................................................................... Patch Set 4: (1 comment) File flashrom.c: https://review.coreboot.org/c/flashrom/+/84203/comment/db3d63e0_6e7fe218?usp... : PS3, Line 487: for (int i = 0; opcode[i]; i++) {
This will always crash if spi_get_opcode_from_erasefn doesn't know the eraser, which should probably be fixed to gracefully bail out.
100% yes, I added a check for null. There are 22 opcodes known to `spi_get_opcode_from_erasefn` and 34 erase functions known to `lookup_erase_func_ptr` ! oh :( yes, we need to check for null. About `FEATURE_NO_ERASE`, I thought those are chips that don't have any erase opcodes, and they just don't support erase operation at all - whether it's erase-before-write or just erase, doesn't matter. The way the feature is implemented is that when such a chip is asked to be erased, the special `SPI_BLOCK_ERASE_EMULATION` is quietly doing write instead of erase, and the end result for the chip memory is the same. So, I added a check for null, but haven't added any comment to FEATURE_NO_ERASE yet. If I would be adding a comment, I would say "chips that don't have erase operation capability, and no erase opcodes"? -- To view, visit https://review.coreboot.org/c/flashrom/+/84203?usp=email To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: flashrom Gerrit-Branch: main Gerrit-Change-Id: I582fe00da0715e9b5e92fcc9d15d5a90a2615117 Gerrit-Change-Number: 84203 Gerrit-PatchSet: 4 Gerrit-Owner: Anastasia Klimchuk <aklm@chromium.org> Gerrit-Reviewer: Miklós Márton <martonmiklosqdev@gmail.com> Gerrit-Reviewer: Peter Marheine <pmarheine@chromium.org> Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org> Gerrit-Attention: Miklós Márton <martonmiklosqdev@gmail.com> Gerrit-Attention: Peter Marheine <pmarheine@chromium.org> Gerrit-Comment-Date: Tue, 10 Sep 2024 11:44:44 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: Peter Marheine <pmarheine@chromium.org>
participants (1)
-
Anastasia Klimchuk (Code Review)