HACK: vboot_api_kernel: Retry EC RW update on unexpected hash failure

Certain versions of kevin EC RO will occasionally flash corrupted data
to a sector rather than the intended flash payload. This manifests
itself after SW sync as a RW hash mismatch. When such a mismatch occurs,
retry the SW sync process up to five times before returning failure and
entering recovery mode.

TEST=Stress test SW sync with faulty RO, verify that recovery mode is
never entered and logs show SW sync was retried after hash fail.

Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Change-Id: I1f38300a95c31e889f94b42718e2996220e9f5a9
Reviewed-on: https://chromium-review.googlesource.com/447957
Reviewed-by: Julius Werner <jwerner@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2 files changed