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

Commit 2185f439 authored by Lijuan Gao's avatar Lijuan Gao Committed by Osvaldo Banuelos
Browse files

power: reset: fix bug on warm reset or hard reset selection



Rebooting to recovery, bootloader and rtc should be treated as
hard reset if PMIC sparse regs are used to store reset reason.
Otherwise it should be set as warm reset to keep compatible with
legacy design. So correct logic of need_warm_reset here.

Change-Id: Ica173cc379df16a28f11bf5da87cb928e73ecdfb
Signed-off-by: default avatarLijuan Gao <lijuang@codeaurora.org>
parent 05877965
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -228,9 +228,6 @@ static void msm_restart_prepare(const char *cmd)
			(in_panic || restart_mode == RESTART_DLOAD));
#endif

	need_warm_reset = (get_dload_mode() ||
				(cmd != NULL && cmd[0] != '\0'));

	if (qpnp_pon_check_hard_reset_stored()) {
		/* Set warm reset as true when device is in dload mode
		 *  or device doesn't boot up into recovery, bootloader or rtc.
@@ -241,6 +238,9 @@ static void msm_restart_prepare(const char *cmd)
			strcmp(cmd, "bootloader") &&
			strcmp(cmd, "rtc")))
			need_warm_reset = true;
	} else {
		need_warm_reset = (get_dload_mode() ||
				(cmd != NULL && cmd[0] != '\0'));
	}

	/* Hard reset the PMIC unless memory contents must be maintained. */