Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c534fa55 authored by Raghavendra Rao Ananta's avatar Raghavendra Rao Ananta Committed by Rishabh Bhatnagar
Browse files

esoc: Introduce stage-3 reset under boot fail action



Under some corner cases, the external modem could not be
configured to listen to warm-reset. For such a scenario,
even if esoc driver issued a warm reset, the modem would not
react to it, leading to a boot failure. Therefore, introduce a
new boot fail action to perform a stage-3 reset such that
the modem could start afresh.

Change-Id: I1cfc93da9cfe90cc6e3244330184d78a02f54c50
Signed-off-by: default avatarRaghavendra Rao Ananta <rananta@codeaurora.org>
parent 6c57dd0a
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@ enum esoc_boot_fail_action {
	BOOT_FAIL_ACTION_SHUTDOWN,
	BOOT_FAIL_ACTION_PANIC,
	BOOT_FAIL_ACTION_NOP,
	BOOT_FAIL_ACTION_S3_RESET,
};

static unsigned int boot_fail_action = BOOT_FAIL_ACTION_PANIC;
@@ -72,6 +73,8 @@ struct mdm_drv {
};
#define to_mdm_drv(d)	container_of(d, struct mdm_drv, cmd_eng)

#define S3_RESET_DELAY_MS	2100

static void esoc_client_link_power_off(struct esoc_clink *esoc_clink,
							unsigned int flags);

@@ -343,6 +346,14 @@ static int mdm_handle_boot_fail(struct esoc_clink *esoc_clink, u8 *pon_trial)
		(*pon_trial)++;
		mdm_power_down(mdm);
		break;
	case BOOT_FAIL_ACTION_S3_RESET:
		mdm_subsys_retry_powerup_cleanup(esoc_clink,
							ESOC_HOOK_MDM_DOWN);
		esoc_mdm_log("Doing an S3 reset\n");
		(*pon_trial)++;
		mdm_power_down(mdm);
		msleep(S3_RESET_DELAY_MS);
		break;
	case BOOT_FAIL_ACTION_PANIC:
		esoc_mdm_log("Calling panic!!\n");
		panic("Panic requested on external modem boot failure\n");