PM: domains: use device's next wakeup to determine domain idle state
authorLina Iyer <ilina@codeaurora.org>
Wed, 20 Jan 2021 15:50:42 +0000 (08:50 -0700)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 22 Jan 2021 16:08:28 +0000 (17:08 +0100)
commitc79aa080fb0f60a0e24c87014dc9c2f373e1379b
treec4ab2f1082966a8bbc6bfd0448ccb0d53f2107c4
parent67e3242ee28052daa90e1fa193efc601939fde58
PM: domains: use device's next wakeup to determine domain idle state

Currently, a PM domain's idle state is determined based on whether the
QoS requirements are met. However, even entering an idle state may waste
power if the minimum residency requirements aren't fulfilled.

CPU PM domains use the next timer wakeup for the CPUs in the domain to
determine the sleep duration of the domain. This is compared with the
idle state residencies to determine the optimal idle state. For other PM
domains, determining the sleep length is not that straight forward. But
if the device's next_event is available, we can use that to determine
the sleep duration of the PM domain.

Let's update the domain governor logic to check for idle state residency
based on the next wakeup of devices as well as QoS constraints. But
since, not all domains may contain devices capable of specifying the
next wakeup, let's enable this additional check only if specified by the
domain's flags when initializing the domain.

Signed-off-by: Lina Iyer <ilina@codeaurora.org>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/base/power/domain_governor.c
include/linux/pm_domain.h