]> git.karo-electronics.de Git - linux-beck.git/commit
PM / Domains: Cache device stop and domain power off governor results, v3
authorRafael J. Wysocki <rjw@sisk.pl>
Tue, 1 May 2012 19:34:07 +0000 (21:34 +0200)
committerRafael J. Wysocki <rjw@sisk.pl>
Sat, 5 May 2012 19:51:58 +0000 (21:51 +0200)
commit6ff7bb0d02f82968be13937c03e93b6c090229df
treeac2605f2f2b1602fddb88c4ba33c647608b594e6
parentefa6902501ffc87d69bfb10b8a09b7d6ee222d77
PM / Domains: Cache device stop and domain power off governor results, v3

The results of the default device stop and domain power off governor
functions for generic PM domains, default_stop_ok() and
default_power_down_ok(), depend only on the timing data of devices,
which are static, and on their PM QoS constraints.  Thus, in theory,
these functions only need to carry out their computations, which may
be time consuming in general, when it is known that the PM QoS
constraint of at least one of the devices in question has changed.

Use the PM QoS notifiers of devices to implement that.  First,
introduce new fields, constraint_changed and max_off_time_changed,
into struct gpd_timing_data and struct generic_pm_domain,
respectively, and register a PM QoS notifier function when adding
a device into a domain that will set those fields to 'true' whenever
the device's PM QoS constraint is modified.  Second, make
default_stop_ok() and default_power_down_ok() use those fields to
decide whether or not to carry out their computations from scratch.

The device and PM domain hierarchies are taken into account in that
and the expense is that the changes of PM QoS constraints of
suspended devices will not be taken into account immediately, which
isn't guaranteed anyway in general.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
drivers/base/power/domain.c
drivers/base/power/domain_governor.c
include/linux/pm_domain.h