Files
rockchip-kernel/kernel
Chirantan Ekbote 15bccc2c63 CHROMIUM: power: Make pm_test delay configurable via a sysfs entry
This allows a user to configure the delay for pm_test by writing the
desired delay in milliseconds to /sys/power/pm_test_delay.  Now that
powerd will be running its event loop even during a dark resume, we need
to ensure that the kernel and devices are in a good state in case powerd
decides to transition from dark resume directly to an awake state.
Selective resume will be our vehicle for this, ensuring that all devices
not necessary during a dark resume are in a runtime suspended state,
thus providing a path for on-demand reactivation of these devices.

Until selective resume is ready however, we can use the pm_test
mechanism to test changes to powerd.  pm_test is designed to debug
suspend/resume issues and allows the user to configure the level to
which the kernel will suspend.  In our case since we want to ensure that
device drivers resume properly, we would suspend down to the 'devices'
level and then follow the proper resume path.  By default, pm_test
delays the suspend at the level requested for 5 seconds but it would be
useful for our testing purposes if that value could be modified
dynamically.

To use pm_test:

$ echo <desired delay> > /sys/power/pm_test_delay
$ echo devices > /sys/power/pm_test
$ echo mem > /sys/power/state

Even with a delay of just a few milliseconds, suspending down to the
'devices' level and resuming still adds about 2.5 seconds of overhead on
a link.

Once selective resume is ready, this patch should be reverted.

BUG=chromium:384488
TEST=manual
Built and deployed on link, verified that the sysfs entry exists, that
invalid values are rejected, and that the suspend is delayed for the
appropriate amount of time after writing to the entry.

Change-Id: I1c616a2e1ad7cd9666796d030f5c1a9526446dac
Signed-off-by: Chirantan Ekbote <chirantan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/204174
Reviewed-by: Sameer Nanda <snanda@chromium.org>
2014-06-19 21:54:27 +00:00
..
2014-02-27 12:38:03 +01:00
2013-11-13 12:09:34 +09:00
2014-04-07 21:52:25 -07:00
2014-01-23 16:37:02 -08:00
2014-05-02 18:50:11 -07:00
2013-12-04 14:09:46 +10:30
2013-12-18 19:04:50 -08:00
2014-01-30 16:56:54 -08:00
2013-09-11 15:58:27 -07:00
2014-05-02 18:50:11 -07:00