Skip to content

Commit

Permalink
PM: domains: Measure power-on/off latencies in genpd based on a governor
Browse files Browse the repository at this point in the history
The measurements of the power-on|off latencies in genpd for a PM domain are
superfluous, unless the corresponding genpd has a governor assigned to it,
which would make use of the data.

Therefore, let's improve the behaviour in genpd by making the measurements
conditional, based upon if there's a governor assigned.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  • Loading branch information
Ulf Hansson authored and Rafael J. Wysocki committed May 19, 2022
1 parent f38d1a6 commit 6961795
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/base/power/domain.c
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,7 @@ static int _genpd_power_on(struct generic_pm_domain *genpd, bool timed)
if (!genpd->power_on)
goto out;

timed = timed && genpd->gd;
if (!timed) {
ret = genpd->power_on(genpd);
if (ret)
Expand All @@ -527,8 +528,7 @@ static int _genpd_power_on(struct generic_pm_domain *genpd, bool timed)
goto out;

genpd->states[state_idx].power_on_latency_ns = elapsed_ns;
if (genpd->gd)
genpd->gd->max_off_time_changed = true;
genpd->gd->max_off_time_changed = true;
pr_debug("%s: Power-%s latency exceeded, new value %lld ns\n",
genpd->name, "on", elapsed_ns);

Expand Down Expand Up @@ -559,6 +559,7 @@ static int _genpd_power_off(struct generic_pm_domain *genpd, bool timed)
if (!genpd->power_off)
goto out;

timed = timed && genpd->gd;
if (!timed) {
ret = genpd->power_off(genpd);
if (ret)
Expand All @@ -577,8 +578,7 @@ static int _genpd_power_off(struct generic_pm_domain *genpd, bool timed)
goto out;

genpd->states[state_idx].power_off_latency_ns = elapsed_ns;
if (genpd->gd)
genpd->gd->max_off_time_changed = true;
genpd->gd->max_off_time_changed = true;
pr_debug("%s: Power-%s latency exceeded, new value %lld ns\n",
genpd->name, "off", elapsed_ns);

Expand Down

0 comments on commit 6961795

Please sign in to comment.