Attention is currently required from: Edward O'Callaghan, Angel Pons, Daniel Campello, Anastasia Klimchuk. Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/59291 )
Change subject: flashrom: Convert do_read() into a libflashrom user ......................................................................
Patch Set 6:
(1 comment)
File cli_classic.c:
https://review.coreboot.org/c/flashrom/+/59291/comment/7fca2f0f_8765753e PS4, Line 635: if (map_flash(&flashes[0]) != 0) { : free(flashes[0].chip); : ret = 1; : goto out_shutdown; : } : msg_cinfo("Please note that forced reads most likely contain garbage.\n"); : ret = do_read(&flashes[0], filename); : unmap_flash(&flashes[0]);
That is a good point, I removed them. Luckily force should by-pass the safety checks called from prepare_flash_access() WDYT?
I would just put it into its own commit for now. If you want to refactor this CLI code that's not a bad idea, I stumbled over this path myself many times. But it seems rather orthogonal to the do_it() conversion.
Also, the forced-read path should be easy to test, e.g. put a PWM signal on MISO and try to read that. Or start by testing it without any signal at all, to see if the control path still works.