From 352a0f843522cf22c79b923cebf219ffac9e2137 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Thu, 17 Sep 2020 10:22:35 -0300 Subject: [PATCH] Fixing factory kill function orderly_poweroff is a function from kernel/reboot.c that does not work since poweroff binary was removed from /sbin/. Factory Kill still worked because qcom smb5 power supply driver disables motorola factory kill and implements its own (with kernel_power_off). Since they removed their own implementation it falls back to the broken one. This commit replace orderly_poweroff by kernel_power_off the same way qcom used to do. Change-Id: Iee78e729add3e31b29c192adc7bcfbab46b1462e Reviewed-on: https://gerrit.mot.com/1753065 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Wentao Xu Reviewed-by: Zhenxin Xi Submit-Approved: Jira Key --- drivers/power/qpnp-smbcharger-mmi/qpnp-smbcharger-mmi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/power/qpnp-smbcharger-mmi/qpnp-smbcharger-mmi.c b/drivers/power/qpnp-smbcharger-mmi/qpnp-smbcharger-mmi.c index d953ee53d7b0..ef950d3b0c29 100755 --- a/drivers/power/qpnp-smbcharger-mmi/qpnp-smbcharger-mmi.c +++ b/drivers/power/qpnp-smbcharger-mmi/qpnp-smbcharger-mmi.c @@ -3499,7 +3499,7 @@ static void mmi_heartbeat_work(struct work_struct *work) chip->factory_kill_armed = true; } else if (chip->factory_kill_armed && !factory_kill_disable) { mmi_warn(chip, "Factory kill power off\n"); - orderly_poweroff(true); + kernel_power_off(); } else chip->factory_kill_armed = false; }