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

Commit 83e8e6e1 authored by Andreas Schneider's avatar Andreas Schneider
Browse files

power: reset: Allow device to preserve memory on restart

Always perform a soft reset as this preserves memory contents, including
pstore and other persistent memory.
parent 89ba8dad
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -103,6 +103,15 @@ config QCOM_DLOAD_MODE
		make the kernel reboot on a kernel panic - that must be
		enabled via another mechanism.

config QCOM_PRESERVE_MEM
	bool "Always preserve memory on restart"
	depends on POWER_RESET_QCOM
	help
	  If crash to download mode is disabled and restart reason is null
	  the system will always perform a hard reset, which wipes out
	  persistent memory contents. Select this option to always perform
	  a soft reset that preserves memory contents.

config POWER_RESET_QNAP
	bool "QNAP power-off driver"
	depends on OF_GPIO && PLAT_ORION
+4 −0
Original line number Diff line number Diff line
@@ -304,6 +304,10 @@ static void msm_restart_prepare(const char *cmd)
	if (in_panic)
		need_warm_reset = true;

#ifdef CONFIG_QCOM_PRESERVE_MEM
	need_warm_reset = true;
#endif

	/* Hard reset the PMIC unless memory contents must be maintained. */
	if (need_warm_reset) {
		qpnp_pon_system_pwr_off(PON_POWER_OFF_WARM_RESET);