]> git.itanic.dy.fi Git - linux-stable/commitdiff
PM: domains: Fix handling of unavailable/disabled idle states
authorSudeep Holla <sudeep.holla@arm.com>
Tue, 25 Oct 2022 12:34:32 +0000 (13:34 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 26 Oct 2022 11:28:39 +0000 (13:28 +0200)
Platforms can provide the information about the availability of each
idle states via status flag. Platforms may have to disable one or more
idle states for various reasons like broken firmware or other unmet
dependencies.

Fix handling of such unavailable/disabled idle states by ignoring them
while parsing the states.

Fixes: a3381e3a65cb ("PM / domains: Fix up domain-idle-states OF parsing")
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/base/power/domain.c

index ead135c7044c677941018afd876e947b85ace12d..6471b559230e977b66bc658348312688a09b3734 100644 (file)
@@ -2952,6 +2952,10 @@ static int genpd_iterate_idle_states(struct device_node *dn,
                np = it.node;
                if (!of_match_node(idle_state_match, np))
                        continue;
+
+               if (!of_device_is_available(np))
+                       continue;
+
                if (states) {
                        ret = genpd_parse_state(&states[i], np);
                        if (ret) {