Skip to content

Commit 6961795

Browse files
Ulf Hanssonrafaeljw
authored andcommitted
PM: domains: Measure power-on/off latencies in genpd based on a governor
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>
1 parent f38d1a6 commit 6961795

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

drivers/base/power/domain.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,7 @@ static int _genpd_power_on(struct generic_pm_domain *genpd, bool timed)
509509
if (!genpd->power_on)
510510
goto out;
511511

512+
timed = timed && genpd->gd;
512513
if (!timed) {
513514
ret = genpd->power_on(genpd);
514515
if (ret)
@@ -527,8 +528,7 @@ static int _genpd_power_on(struct generic_pm_domain *genpd, bool timed)
527528
goto out;
528529

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

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

562+
timed = timed && genpd->gd;
562563
if (!timed) {
563564
ret = genpd->power_off(genpd);
564565
if (ret)
@@ -577,8 +578,7 @@ static int _genpd_power_off(struct generic_pm_domain *genpd, bool timed)
577578
goto out;
578579

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

0 commit comments

Comments
 (0)