UPSTREAM: flashrom: initialize restore func count in correct place
Set `flash->chip_restore_fn_count` to zero before calling the chip's
unlock funciton in `prepare_flash_access()`.
Previously `flash->chip_restore_fn_count` was uninitialized before
calling `chip->unlock()` and subsequently reset after the dispatch by
initializing it. This caused the restore handler that is registered
within `spi_disable_blockprotect_generic()` to be lost.
BUG=b:228945411
BRANCH=none
TEST=enable wp; flashrom -w; check wp still enabled.
Original-Commit-Id: b86ae179adfb4acb4190ef2abe2ee8905c44f26a
Original-Change-Id: I4c7df424bd2ae2b5fb2a2ab6b47a3c9ff3233acf
Original-Signed-off-by: Nikolai Artemiev <nartemiev@google.com>
Original-Reviewed-on: https://review.coreboot.org/c/flashrom/+/63881
Original-Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Original-Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
Original-Reviewed-by: Angel Pons <th3fanbus@gmail.com>
(cherry picked from commit b86ae179adfb4acb4190ef2abe2ee8905c44f26a)
Signed-off-by: Evan Benn <evanbenn@chromium.org>
Change-Id: I2810ce81b9186916cedaae8594196ce4a069050f
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/flashrom/+/3670097
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Reviewed-by: Peter Marheine <pmarheine@chromium.org>
Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
1 file changed