power: use orderly shutdown
authorzhaoxp3 <zhaoxp3@motorola.com>
Fri, 19 Apr 2019 01:50:18 +0000 (09:50 +0800)
committerxiest1 <xiest1@lenovo.com>
Tue, 5 Nov 2019 09:32:01 +0000 (17:32 +0800)
User an orderly shutdown for factory kill instead of a
kernel power off.  The orderly shutdown will attempt to
call the reboot binary from userspace first, and then
fallback to kernel power off if it fails.

Change-Id: Ia05f1c9e1ca25b403a4c5507da2d61d267e67Defender
Signed-off-by: zhaoxp3 <zhaoxp3@motorola.com>
Reviewed-on: https://gerrit.mot.com/1339132
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Wei Xu <xuwei9@mt.com>
Submit-Approved: Jira Key

drivers/power/supply/s2mu00x_battery.c

index 5c5b355e78c60c9d7c357319b14275cb0f1068ea..866b19b688bb2edccb751ac58e4ebdc8a79b6755 100644 (file)
@@ -4281,7 +4281,7 @@ void factory_usb_shutdown(struct s2mu00x_battery_info *chip)
        if (chip->factory_cable) {
                if (!factory_kill_disable) {
                        printk(KERN_ERR "SMB - Factory Cable removed, power-off\n");
-                       kernel_power_off();
+                       orderly_poweroff(true);
                } else
                        pr_err("SMB - Factory cable removed - kill disabled\n");
                chip->factory_cable = false;