Attention is currently required from: Nico Huber, Angel Pons, Anastasia Klimchuk, Sergii Dmytruk. Nikolai Artemiev has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/59074 )
Change subject: [RFC][WPTST] dummyflasher: enforce write protection for W25Q128FV ......................................................................
Patch Set 12: Code-Review+1
(2 comments)
File dummyflasher.c:
https://review.coreboot.org/c/flashrom/+/59074/comment/5c6359ec_9c40f4f3 PS10, Line 264: /* XXX: should data->erase_to_zero be taken into account here? */
It does look like a bug to me, thanks! […]
+1, preserving the current behavior with a FIXME comment is the best option IMO.
File dummyflasher.c:
https://review.coreboot.org/c/flashrom/+/59074/comment/52613586_ce3bec06 PS12, Line 236: if (start >= data->wp_start && start < data->wp_end) : return true; : : const uint32_t last = start + len - 1; : return (last >= data->wp_start && last < data->wp_end); These two tests can be combined as:
const uint32_t last = start + len - 1; return (start < data->wp_end && last >= data->wp_start);
Actually they need to combined to catch the theoretical case where the region being written strictly contains the protection region. Although that isn't an issue for now since most chips only have protection regions at one end of address space.