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

Commit 053e9057 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "esoc: Introduce stage-3 reset under boot fail action"

parents a8ad7065 c534fa55
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");