janke99 / android-virtualbox

Automatically exported from code.google.com/p/android-virtualbox
0 stars 0 forks source link

Power management - ACPI support #12

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Power management through ACPI is not enabled in AOSP vbox support.
To have it, we need to :
- Add ACPI to the kernel through vbox_defconfig
- Solve the problem where VirtualBox don't send ACPI events on power management 
events (plug/unplug charger, battery level changing, ...) : my solution (not so 
elegant but I don't think of any other one) is to poll events at a reasonable 
frequency (30 secs)

I already have done this on my local source tree.
I have to submit the patches.

Dan.

Original issue reported on code.google.com by dfa...@gmail.com on 19 Jan 2012 at 6:55

GoogleCodeExporter commented 9 years ago
Could you post the ACPI config changes upstream? I'm (experimentally) testing 
all of our changes in aggregate, ported forward to 3.0.8 (kernel/common), and I 
want to make sure I'm making the same changes as you for ACPI support.

Original comment by e...@boraas.ca on 21 Jan 2012 at 5:39

GoogleCodeExporter commented 9 years ago
Here's my diff concerning the kernel config file :

--- arch/x86/configs/vbox_defconfig     2012-01-18 02:33:21.000000000 +0300
+++ arch/x86/configs/vbox_defconfig_4.0.3_bd2 2012-01-21 09:30:02.000000000 
+0300
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
 # Linux kernel version: 2.6.29
-# Wed Jan 18 02:29:15 2012
+# Sun Jan 15 17:29:59 2012
 #
 # CONFIG_64BIT is not set
 CONFIG_X86_32=y
@@ -160,7 +160,7 @@
 CONFIG_DEFAULT_CFQ=y
 # CONFIG_DEFAULT_NOOP is not set
 CONFIG_DEFAULT_IOSCHED="cfq"
-# CONFIG_FREEZER is not set
+CONFIG_FREEZER=y

 # Power management and ACPI options
 #
 CONFIG_PM=y
-# CONFIG_PM_DEBUG is not set
-# CONFIG_SUSPEND is not set
+CONFIG_PM_DEBUG=y
+CONFIG_PM_VERBOSE=y
+CONFIG_CAN_PM_TRACE=y
+# CONFIG_PM_TRACE_RTC is not set
+CONFIG_PM_SLEEP_SMP=y
+CONFIG_PM_SLEEP=y
+CONFIG_SUSPEND=y
+# CONFIG_PM_TEST_SUSPEND is not set
+CONFIG_SUSPEND_FREEZER=y
 CONFIG_HAS_WAKELOCK=y
 CONFIG_HAS_EARLYSUSPEND=y
 CONFIG_WAKELOCK=y

@@ -331,7 +339,29 @@
 # CONFIG_CONSOLE_EARLYSUSPEND is not set
 CONFIG_FB_EARLYSUSPEND=y
 # CONFIG_HIBERNATION is not set
-# CONFIG_ACPI is not set
+CONFIG_ACPI=y
+CONFIG_ACPI_SLEEP=y
+# CONFIG_ACPI_PROCFS is not set
+CONFIG_ACPI_PROCFS_POWER=y
+CONFIG_ACPI_SYSFS_POWER=y
+CONFIG_ACPI_PROC_EVENT=y
+CONFIG_ACPI_AC=y

+CONFIG_ACPI_BATTERY=y
+CONFIG_ACPI_BUTTON=y
+CONFIG_ACPI_FAN=y
+CONFIG_ACPI_DOCK=y
+CONFIG_ACPI_PROCESSOR=y
+CONFIG_ACPI_HOTPLUG_CPU=y
+CONFIG_ACPI_THERMAL=y
+# CONFIG_ACPI_CUSTOM_DSDT is not set
+CONFIG_ACPI_BLACKLIST_YEAR=0
+CONFIG_ACPI_DEBUG=y
+# CONFIG_ACPI_DEBUG_FUNC_TRACE is not set

+# CONFIG_ACPI_PCI_SLOT is not set
+CONFIG_X86_PM_TIMER=y
+CONFIG_ACPI_CONTAINER=y
+# CONFIG_ACPI_SBS is not set
+# CONFIG_APM is not set

Dan.

Original comment by dfa...@gmail.com on 21 Jan 2012 at 6:40

GoogleCodeExporter commented 9 years ago
I've submitted a patch to Gerrit to solve the fact that VBox don't send ACPI 
events.
Here it is : https://android-review.googlesource.com/#/c/31582/
I just have to also submit the patch to add ACPI to the kernel config and we 
switch the status to "Submitted".

Dan.

Original comment by dfa...@gmail.com on 25 Jan 2012 at 2:42

GoogleCodeExporter commented 9 years ago
Patch submitted for ACPI support in kernel : 
https://android-review.googlesource.com/#/c/31660/

State --> Submitted

Original comment by dfa...@gmail.com on 25 Jan 2012 at 8:57