summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/soc/intel/baytrail/mrc_cache.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/soc/intel/baytrail/mrc_cache.c b/src/soc/intel/baytrail/mrc_cache.c
index 5613761ce5..ae0afe7f7f 100644
--- a/src/soc/intel/baytrail/mrc_cache.c
+++ b/src/soc/intel/baytrail/mrc_cache.c
@@ -275,9 +275,12 @@ static void update_mrc_cache(void *unused)
next_slot = mrc_cache_next_slot(&region, current_saved);
if (!mrc_slot_valid(&region, next_slot, current_boot)) {
- if (nvm_erase(region.base, region.size) < 0) {
- printk(BIOS_DEBUG, "Could not erase MRC region.\n");
- return;
+ printk(BIOS_DEBUG, "Slot @ %p is invalid.\n", next_slot);
+ if (!nvm_is_erased(region.base, region.size)) {
+ if (nvm_erase(region.base, region.size) < 0) {
+ printk(BIOS_DEBUG, "Failure erasing region.\n");
+ return;
+ }
}
next_slot = region.base;
}