cpuidle: Allow idle states to be disabled by default
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 13 Dec 2019 08:56:13 +0000 (09:56 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 27 Dec 2019 10:02:08 +0000 (11:02 +0100)
commit75a80267410e38ab76c4ceb39753f96d72113781
tree08c172e0d40ae21128686957ec078065ef4bc1d0
parent18734958e9bfbc055805d110a38dc76307eba742
cpuidle: Allow idle states to be disabled by default

In certain situations it may be useful to prevent some idle states
from being used by default while allowing user space to enable them
later on.

For this purpose, introduce a new state flag, CPUIDLE_FLAG_OFF, to
mark idle states that should be disabled by default, make the core
set CPUIDLE_STATE_DISABLED_BY_USER for those states at the
initialization time and add a new state attribute in sysfs,
"default_status", to inform user space of the initial status of
the given idle state ("disabled" if CPUIDLE_FLAG_OFF is set for it,
"enabled" otherwise).

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Documentation/ABI/testing/sysfs-devices-system-cpu
Documentation/admin-guide/pm/cpuidle.rst
drivers/cpuidle/cpuidle.c
drivers/cpuidle/sysfs.c
include/linux/cpuidle.h