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. Change-Id: Ideca44c9f38d2ebcd437ff289f8e036922eafcd2 Signed-off-by: Sorayukii <sorayukii69@gmail.com>
This commit is contained in:
parent
0fbc152fd1
commit
95b03f8127
2 changed files with 13 additions and 0 deletions
|
|
@ -124,6 +124,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
|
||||
|
|
|
|||
|
|
@ -311,6 +311,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 (force_warm_reboot || need_warm_reset)
|
||||
qpnp_pon_system_pwr_off(PON_POWER_OFF_WARM_RESET);
|
||||
|
|
|
|||
Loading…
Reference in a new issue