max_m5: add criteria to rerun loading custom parameters
Test for a race condition between AP SW and FG firmware during the model loading process. Add register value checks and rerun on failure due to the simultaneous update of the value by firmware.
Bug: 240115405
Change-Id: I39da136336be92cc6afa1d3f650383121b0a52ac
Signed-off-by: Jenny Ho <[email protected]>
diff --git a/max_m5.h b/max_m5.h
index 29bcaa8..62fc4b5 100644
--- a/max_m5.h
+++ b/max_m5.h
@@ -50,6 +50,7 @@
#define MAX_M5_RECAL_MAX_ROUNDS 3
+#define MAX_M5_RETRY_TIMES 3
/** ------------------------------------------------------------------------ */
@@ -130,6 +131,7 @@
u16 *custom_model;
u32 model_version;
bool force_reset_model_data;
+ int load_retry;
/* to/from GMSR */
struct model_state_save model_save;