summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/flash.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/common/flash.c b/common/flash.c
index bc23636550..6e7d8dba6b 100644
--- a/common/flash.c
+++ b/common/flash.c
@@ -494,11 +494,12 @@ static void flash_abort_or_invalidate_hash(int offset, int size)
#ifdef CONFIG_EXTERNAL_STORAGE
/*
- * If EC executes in RAM, we keep the current hash. On the next
- * hash check, AP will catch hash mismatch between the flash
- * copy and the RAM copy, then take necessary actions.
+ * If EC executes in RAM and is currently in RW, we keep the current
+ * hash. On the next hash check, AP will catch hash mismatch between the
+ * flash copy and the RAM copy, then take necessary actions.
*/
- return;
+ if (system_is_in_rw())
+ return;
#endif
/* If EC executes in place, we need to invalidate the cached hash. */