Skip to content

Commit

Permalink
Merge branch 'pm-domains'
Browse files Browse the repository at this point in the history
* pm-domains:
  PM / domains: Remove one unnecessary blank line
  PM / Domains: Return early for all errors in _genpd_power_off()
  PM / Domains: Improve warn for multiple states but no governor
  • Loading branch information
rafaeljw committed Mar 14, 2019
2 parents 4650b27 + d9dfca7 commit 75f3e23
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
8 changes: 4 additions & 4 deletions drivers/base/power/domain.c
Original file line number Diff line number Diff line change
Expand Up @@ -459,19 +459,19 @@ static int _genpd_power_off(struct generic_pm_domain *genpd, bool timed)

time_start = ktime_get();
ret = genpd->power_off(genpd);
if (ret == -EBUSY)
if (ret)
return ret;

elapsed_ns = ktime_to_ns(ktime_sub(ktime_get(), time_start));
if (elapsed_ns <= genpd->states[state_idx].power_off_latency_ns)
return ret;
return 0;

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

return ret;
return 0;
}

/**
Expand Down Expand Up @@ -1768,7 +1768,7 @@ int pm_genpd_init(struct generic_pm_domain *genpd,
ret = genpd_set_default_power_state(genpd);
if (ret)
return ret;
} else if (!gov) {
} else if (!gov && genpd->state_count > 1) {
pr_warn("%s: no governor for states\n", genpd->name);
}

Expand Down
1 change: 0 additions & 1 deletion drivers/base/power/domain_governor.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ static bool __default_power_down_ok(struct dev_pm_domain *pd,
off_on_time_ns = genpd->states[state].power_off_latency_ns +
genpd->states[state].power_on_latency_ns;


min_off_time_ns = -1;
/*
* Check if subdomains can be off for enough time.
Expand Down

0 comments on commit 75f3e23

Please sign in to comment.