OSDN Git Service

PM: domains: Add support for PM domain on/off notifiers for genpd
authorUlf Hansson <ulf.hansson@linaro.org>
Tue, 13 Oct 2020 12:23:39 +0000 (14:23 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 16 Oct 2020 15:39:06 +0000 (17:39 +0200)
commitd4f8138354b9ec290de0c7ba527a945c5549e32b
tree3f02d09cb139bde00f692090613276e785a1f39f
parentdefb53a7c790f9e37a765de8a5d830ed15e2055b
PM: domains: Add support for PM domain on/off notifiers for genpd

A device may have specific HW constraints that must be obeyed to, before
its corresponding PM domain (genpd) can be powered off - and vice verse at
power on. These constraints can't be managed through the regular runtime PM
based deployment for a device, because the access pattern for it, isn't
always request based. In other words, using the runtime PM callbacks to
deal with the constraints doesn't work for these cases.

For these reasons, let's instead add a PM domain power on/off notification
mechanism to genpd. To add/remove a notifier for a device, the device must
already have been attached to the genpd, which also means that it needs to
be a part of the PM domain topology.

To add/remove a notifier, let's introduce two genpd specific functions:
 - dev_pm_genpd_add|remove_notifier()

Note that, to further clarify when genpd power on/off notifiers may be
used, one can compare with the existing CPU_CLUSTER_PM_ENTER|EXIT
notifiers. In the long run, the genpd power on/off notifiers should be able
to replace them, but that requires additional genpd based platform support
for the current users.

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