From: zhaoxp3 Date: Fri, 19 Apr 2019 01:50:18 +0000 (+0800) Subject: power: use orderly shutdown X-Git-Tag: MMI-RSBS31.Q1-48-36-26~180 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e041cc587f04e6084f0b434b34bb0a33c55b07cc;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git power: use orderly shutdown 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: Ia05f1c9e1ca25b403a4c5507da2d61d267e67def Signed-off-by: zhaoxp3 Reviewed-on: https://gerrit.mot.com/1339132 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Wei Xu Submit-Approved: Jira Key --- diff --git a/drivers/power/supply/s2mu00x_battery.c b/drivers/power/supply/s2mu00x_battery.c index 5c5b355e78c6..866b19b688bb 100644 --- a/drivers/power/supply/s2mu00x_battery.c +++ b/drivers/power/supply/s2mu00x_battery.c @@ -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;