Skip to content

Commit

Permalink
PM: domains: log failures to register always-on domains
Browse files Browse the repository at this point in the history
Always-on PM domains must be on during initialisation or the domain is
currently silently rejected.

Print an error message in case an always-on domain is not on to make it
easier to debug drivers getting this wrong (e.g. by setting an always-on
genpd flag without making sure that the state matches).

Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Reviewed-by: Kevin Hilman <khilman@baylibre.com>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  • Loading branch information
Johan Hovold authored and Rafael J. Wysocki committed Oct 4, 2022
1 parent c79e6fa commit 129b60c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/base/power/domain.c
Original file line number Diff line number Diff line change
Expand Up @@ -2085,8 +2085,10 @@ int pm_genpd_init(struct generic_pm_domain *genpd,

/* Always-on domains must be powered on at initialization. */
if ((genpd_is_always_on(genpd) || genpd_is_rpm_always_on(genpd)) &&
!genpd_status_on(genpd))
!genpd_status_on(genpd)) {
pr_err("always-on PM domain %s is not on\n", genpd->name);
return -EINVAL;
}

/* Multiple states but no governor doesn't make sense. */
if (!gov && genpd->state_count > 1)
Expand Down

0 comments on commit 129b60c

Please sign in to comment.