So, I finished the rewrite of IDLE2 off today.
So far it seems ok, well, it's still the same code which takes the system into idle, it's just a different way of implementing it, which hopefully will be better.
I will be doing a release with it included tomorrow assuming no issues.
From the git commit:
v0.200 is a complete rewrite of the
majority of the idle2 codebase. 2 idle states have now been
fully implemented and are available at all times. The
states are IDLE and IDLE2, which is DEEP-IDLE TOP OFF.
DEEP-IDLE TOP ON is not implemented, as it has no benefit.
The hot code paths are now more optimised and faster.
Workqueues are used to inform idle2 of events from other subsystems,
such as audio, usb connected and bluetooth.
PM notifiers are used to notify idle2 of a suspend, although it should
never get into a situation where it is working at the same time as the
system is suspending.
The IDLE2 mode will only be activated when audio has been playing back
for more than 30 seconds, the device is not connected to USB, bluetooth is
not active (it can be enabled, but not be actively working) various clocks
are gated (in practice, this means that the screen has to be off), certain
subsystems are not active and there are no interrupts pending.
The early suspend and late resume hooks have been removed as they are not
required, as have the suspend and resume hooks.
Many of the idle2 specific functions have been split into idle2.h to keep
them separate from the stock code.
IDLE2 can be disabled with the following command:
echo 1 > /sys/module/cpuidle/parameters/idle2_disabled
Stats can be obtained from the standard cpuidle interface, which, for
IDLE2 is located at: