Attention is currently required from: Nikolai Artemiev.
Hello Nikolai Artemiev,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/flashrom/+/67720
to review the following change.
Change subject: writeprotect: Add some debug logging if wp_verify fails ......................................................................
writeprotect: Add some debug logging if wp_verify fails
Change-Id: I5fcaf767570418f90ae44826a1135d9b49653033 Signed-off-by: Evan Benn evanbenn@chromium.org --- M writeprotect.c 1 file changed, 18 insertions(+), 3 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/20/67720/1
diff --git a/writeprotect.c b/writeprotect.c index 57d0f9b..c32bee1 100644 --- a/writeprotect.c +++ b/writeprotect.c @@ -155,6 +155,7 @@ return FLASHROM_WP_ERR_WRITE_FAILED; }
+ enum flashrom_wp_result ret = FLASHROM_WP_OK; /* Verify each register */ for (enum flash_reg reg = STATUS1; reg < MAX_REGISTERS; reg++) { if (!write_masks[reg]) @@ -164,14 +165,18 @@ if (wp_read_register(flash, reg, &value)) return FLASHROM_WP_ERR_READ_FAILED;
+ msg_cdbg2("wp_verify reg:%u value:0x%x\n", reg, value); uint8_t actual = value & write_masks[reg]; uint8_t expected = reg_values[reg] & write_masks[reg];
- if (actual != expected) - return FLASHROM_WP_ERR_VERIFY_FAILED; + if (actual != expected) { + msg_cdbg("wp_verify failed: reg:%u actual:0x%x expected:0x%x\n", reg, + actual, expected); + ret = FLASHROM_WP_ERR_VERIFY_FAILED; + } }
- return FLASHROM_WP_OK; + return ret; }
/** Get the range selected by a WP configuration. */