From: Valentin Manea Date: Fri, 12 Apr 2019 08:31:45 +0000 (+0800) Subject: Allow to disable offlining of non-boot CPUs X-Git-Tag: android-x86-7.1-r3 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=refs%2Ftags%2Fandroid-x86-7.1-r3;p=android-x86%2Fhardware-x86power.git Allow to disable offlining of non-boot CPUs On my Cherrytrail tablet I've been trying to achieve the S0Ix deep sleep states. After a bit of twiddling I found out that I can achieve the deep sleep states but I need to disable the power off of the secondary cores otherwise the resume from sleep causes the device to crash. The patch uses a property to determine whether to power off the non-boot CPUs on sleeping. --- diff --git a/power.c b/power.c index cd284d5..7d2a4ac 100644 --- a/power.c +++ b/power.c @@ -74,7 +74,9 @@ static void power_set_interactive(struct power_module *module UNUSED, int on) } } - set_nonboot_cpu_state(on ? CPU_ONLINE : CPU_OFFLINE); + if (property_get_bool("power.nonboot-cpu-off", 1)) { + set_nonboot_cpu_state(on ? CPU_ONLINE : CPU_OFFLINE); + } } static void power_hint(struct power_module *module UNUSED, power_hint_t hint, void *data UNUSED)