RFC: x86power disable secondary CPU poweroff

425 views
Skip to first unread message

valenti...@gmail.com

unread,
Apr 6, 2019, 8:39:49 PM4/6/19
to Android-x86
Hi,

On my cherrytrail table 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. For myself I just recompiled with that line of code removed:
 77 //    set_nonboot_cpu_state(on ? CPU_ONLINE : CPU_OFFLINE);⏎                    

  This makes a huge difference in power consumption while sleeping.

  Anybody interested in adding a boot property to disable the offlining of nonboot CPUs? Depending on the Hardware name the non boot CPU operation could be disabled.


Regards,

Chih-Wei Huang

unread,
Apr 7, 2019, 11:38:19 PM4/7/19
to Android-x86
<valenti...@gmail.com> 於 2019年4月7日 週日 上午8:39寫道:
Yes, sounds like a good suggestion.
Could you provide a patch? Thanks!


--
Chih-Wei
Android-x86 project
http://www.android-x86.org

valenti...@gmail.com

unread,
Apr 10, 2019, 12:20:00 PM4/10/19
to Android-x86
Hi,

  The patch is quite small(secondary_power.patch) and it applies to the hardware/x86power project.
  I also add at least one device where it's required Teclast X80 Power to init.sh(teclast_nonboot.patch). Without this patch it's impossible to achieve S0ix states as described in this article: https://01.org/blogs/qwang59/2018/how-achieve-s0ix-states-linux The difference between s2idle and S0ix is quite huge in deep sleep consumption.

  The tablet I mentioned above (Teclast X80 power) has also given me some troubles with audio and needs some alsa_ucm calls in init.sh but the patches are quite large. I'll try to post them separately. It seems many cherry trails have issues with audio and the information google gives is a bit contradictory.

Regards,
teclast_nonboot.patch
secondary_power.patch

Chih-Wei Huang

unread,
Apr 12, 2019, 4:53:27 AM4/12/19
to Android-x86
<valenti...@gmail.com> 於 2019年4月11日 週四 上午12:20寫道:
>
> The patch is quite small(secondary_power.patch) and it applies to the hardware/x86power project.
> I also add at least one device where it's required Teclast X80 Power to init.sh(teclast_nonboot.patch). Without this patch it's impossible to achieve S0ix states as described in this article: https://01.org/blogs/qwang59/2018/how-achieve-s0ix-states-linux The difference between s2idle and S0ix is quite huge in deep sleep consumption.

Thank you for the patches.
I've applied them.

> The tablet I mentioned above (Teclast X80 power) has also given me some troubles with audio and needs some alsa_ucm calls in init.sh but the patches are quite large. I'll try to post them separately. It seems many cherry trails have issues with audio and the information google gives is a bit contradictory.

Thanks!

Best Regards,

youling 257

unread,
Nov 13, 2019, 4:58:18 AM11/13/19
to Android-x86
what is the mean of it ? this patch is break.
the default function is set_nonboot_cpu_state(on ? CPU_ONLINE : CPU_OFFLINE), this patch just add "if power.nonboot-cpu-off=1" then do it, this if necessary ?

在 2019年4月11日星期四 UTC+8上午12:20:00,valent...@gmail.com写道:

youling 257

unread,
Nov 13, 2019, 5:34:43 AM11/13/19
to Android-x86
reboot to Android, no the power.nonboot-cpu-off prop, sleep wakeup, why the default function is still cpu offline?
[ 157.078387] smpboot: CPU 1 is now offline
[ 157.128958] smpboot: CPU 2 is now offline
[ 157.144583] smpboot: CPU 3 is now offline
[ 157.484161] x86: Booting SMP configuration:
[ 157.484168] smpboot: Booting Node 0 Processor 1 APIC 0x2
[ 157.486013] smpboot: Booting Node 0 Processor 2 APIC 0x4
[ 157.489104] smpboot: Booting Node 0 Processor 3 APIC 0x6
setprop power.nonboot-cpu-off 0, then sleep wakeup, no the cpu offline.

the default function is cpu offline, why you still need init.sh "setprop power.nonboot-cpu-off 1" for your tablet?
I needn't cpu offline when sleep, 4 core cpu all reach 80% c7 state when sleep.
make power.x86 default function is no the cpu off ?

youling 257

unread,
Nov 13, 2019, 5:40:21 AM11/13/19
to Android-x86
 77 // set_nonboot_cpu_state(on ? CPU_ONLINE : CPU_OFFLINE);
you need remove these code for you tablet, if you remove them, when your tablet sleep, will no the cpu off function.
but the init.sh patch for your tablet, cause cpu off when it sleep.

I think s0ix sleep state require all the cpu core at least reach 80% c7/c8/c9 state.

在 2019年4月7日星期日 UTC+8上午8:39:49,valent...@gmail.com写道:

Chih-Wei Huang

unread,
Nov 13, 2019, 11:54:06 PM11/13/19
to Android-x86
youling 257 <youli...@gmail.com> 於 2019年11月13日 週三 下午6:34寫道:
>
> reboot to Android, no the power.nonboot-cpu-off prop, sleep wakeup, why the default function is still cpu offline?
> [ 157.078387] smpboot: CPU 1 is now offline
> [ 157.128958] smpboot: CPU 2 is now offline
> [ 157.144583] smpboot: CPU 3 is now offline
> [ 157.484161] x86: Booting SMP configuration:
> [ 157.484168] smpboot: Booting Node 0 Processor 1 APIC 0x2
> [ 157.486013] smpboot: Booting Node 0 Processor 2 APIC 0x4
> [ 157.489104] smpboot: Booting Node 0 Processor 3 APIC 0x6
> setprop power.nonboot-cpu-off 0, then sleep wakeup, no the cpu offline.
>
> the default function is cpu offline, why you still need init.sh "setprop power.nonboot-cpu-off 1" for your tablet?

I see your point.
Looks like it should be "setprop power.nonboot-cpu-off 0".

Hi valentin, could you confirm?

> I needn't cpu offline when sleep, 4 core cpu all reach 80% c7 state when sleep.
> make power.x86 default function is no the cpu off ?



Daniel Cheung

unread,
Nov 16, 2019, 11:46:08 PM11/16/19
to andro...@googlegroups.com
I added the following lines to init.sh
set_property power.nonboot-cpu-off 0
set_property sleep.state standby

When I press the power button, the screen goes off. However, trying to wake up by pressing the power button again, I got a black screen. The device seem to be on since it's still warm but I'm not sure if it's waking up correctly. Attached is a copy of the log file I got in debug mode. My device is a X98 Plus tablet which is similar to the X80 valentin is using. I believe line 1867 is where sleep was triggered.



--
You received this message because you are subscribed to the Google Groups "Android-x86" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-x86...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-x86/CAKc24n1U22XuR_uAfRJ1pYOe198YGHK%3D-FFctGtaNioSuvRxww%40mail.gmail.com.
log.txt

youling 257

unread,
Nov 17, 2019, 10:30:08 AM11/17/19
to Android-x86
To unsubscribe from this group and stop receiving emails from it, send an email to andro...@googlegroups.com.

Daniel Cheung

unread,
Nov 27, 2019, 8:19:05 PM11/27/19
to andro...@googlegroups.com
Tried "force" as the setting for sleep.state and have the same black screen / no reaction behavior. I didn't test in debug so no logs to attach. If you want logs, I can do the test one more time before I revert to 7.1 R3 with 4.9 Kernel.

To unsubscribe from this group and stop receiving emails from it, send an email to android-x86...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-x86/dae654b6-2647-4ae7-9c66-07e7c602c10f%40googlegroups.com.

youling 257

unread,
Nov 27, 2019, 10:23:13 PM11/27/19
to Android-x86
sleep.state force only support 8.1 r3 and r2.
9.0 rc1 long press power button, you can see sleep option, http://git.osdn.net/view?p=android-x86/frameworks-base.git;a=commit;h=8078bf07d35842c7a095c401c44061e8e9df23bb , only support 9.0 rc1.
please test 9.0 rc1, use the long press power button menu.

在 2019年11月28日星期四 UTC+8上午9:19:05,BrokenE39写道:

youling 257

unread,
Nov 27, 2019, 10:26:44 PM11/27/19
to Android-x86
not log, it's dmesg.
[46774.662148] PM: suspend entry (s2idle)
[46774.696186] Filesystems sync: 0.033 seconds
[46774.711453] Freezing user space processes ... (elapsed 0.004 seconds) done. 
[46774.716260] OOM killer disabled.

[46777.739369] OOM killer enabled.
[46777.739472] Restarting tasks ... done. 
[46777.749793] PM: suspend exit

在 2019年11月28日星期四 UTC+8上午9:19:05,BrokenE39写道:
Tried "force" as the setting for sleep.state and have the same black screen / no reaction behavior. I didn't test in debug so no logs to attach. If you want logs, I can do the test one more time before I revert to 7.1 R3 with 4.9 Kernel.

Daniel Cheung

unread,
Nov 27, 2019, 11:12:57 PM11/27/19
to andro...@googlegroups.com
Sure, I can give 9.1 RC1 a try first. Will dmesg able to read the content from kernel ring after a hard reset (hold down power until the device reboot)?

To unsubscribe from this group and stop receiving emails from it, send an email to android-x86...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-x86/d55c64b8-f527-4866-9a36-64b0453babbf%40googlegroups.com.

Daniel Cheung

unread,
Nov 27, 2019, 11:13:39 PM11/27/19
to andro...@googlegroups.com
Sure I can give 9.0 RC1 a try first. Will dmesg able to read from kernel ring after a hard reset (hold power button down until it reboots)?

On Wed, Nov 27, 2019 at 7:26 PM youling 257 <youli...@gmail.com> wrote:
To unsubscribe from this group and stop receiving emails from it, send an email to android-x86...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-x86/d55c64b8-f527-4866-9a36-64b0453babbf%40googlegroups.com.

Daniel Cheung

unread,
Dec 14, 2019, 12:02:56 AM12/14/19
to andro...@googlegroups.com
I did some more testing in 8.1 RC3 with sleep.state=force. It turns out that the device does wake up but the screen brightness won't return to the previous value so it shows as black screen. I figured that out when I press the power button once and then long press it again and touched the screen region where the "Shutdown" and "Restart" buttons would pop up. I notice the device making a button press sound so I knew it was awake. Pressing the power button again, the device powered up.

`
[  842.101940] PM: suspend entry (s2idle)
[  842.101945] PM: Syncing filesystems ... done.
[  842.131068] Freezing user space processes ... (elapsed 0.002 seconds) done.
[  842.133364] OOM killer disabled.
[  842.133366] Freezing remaining freezable tasks ... (elapsed 0.000 seconds) done.
[  842.134356] Suspending console(s) (use no_console_suspend to debug)
[  842.510744] rtc_cmos 00:04: suspend, ctrl 02
[  842.510918] serial 00:01: disabled
[  843.453812] RTL8723BS:  suspend start
[  843.454461] RTL8723BS: rtw_cmd_thread(wlan0) stop_req:1, break
[  843.457426] RTL8723BS: rtw_dev_unload: driver not in IPS
[  843.467026] RTL8723BS: rtw suspend success in 13 ms
[ 6371.439330] RTL8723BS: resume start
`
I kind of implemented a work around using Tasker. When I shake the device so it detects a "Face Up" motion, it sets the brightness to a certain value. So I just have to press the power to wake up the device, wait a few seconds and shake the device to trigger the task. I'll open a new post regarding that problem.

ouija

unread,
Nov 23, 2020, 3:33:11 AM11/23/20
to Android-x86
I've recently been trying to enable s0ix with s2idle in my custom [8.1r5] build for my Toshiba WT8-B, and can 100% confirm that in order to do so, I need  to have both properties set:

set_property power.nonboot-cpu-off 0
set_property sleep.state force

And that I also had to set the acpi_backlight=vendor kernel argument via GRUB (android.cfg) or else this device would have issues with a black screen during resume from sleep, due to an additional entry being created by ACPI under /sys/class/backlight which was interfering with backlight levels on resume (only intel_backlight should exist)

@BrokenE39 have you tried something similar to see if this resolves your issue?

Hope this helps!

Daniel Cheung

unread,
Nov 23, 2020, 1:17:40 PM11/23/20
to andro...@googlegroups.com
I tried them individually before in Android 8 without much success. Right now in 9, I'm just running nonboot cpu off = 0 in init.sh and Intel max cstate idle of 4 in GRUB and I say 80% of the time it would black screen on me on resume. Furthermore, I noticed that when I long press the power button and pick sleep, the screen goes black and then powers on again for 1 second and black screen again. Not sure if it's because of the kernel not supporting Cherrytrail or I need to try all 3 of these options. Let me try it out this week to see if I can gain any improvement. My next goal is to compile 5.8 kernel for my Teclast tablet to see if I can gain better HD support. It's stuck at 1080p 30fps max on Youtube and has laggy performance in Plex. Someone else provided instructions to update the hw acceleration for Intel iGPU but haven't tried those yet (was that you or crw?).

--
You received this message because you are subscribed to the Google Groups "Android-x86" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-x86...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages