From: Sudeep Holla Date: Tue, 25 Oct 2022 12:34:32 +0000 (+0100) Subject: PM: domains: Fix handling of unavailable/disabled idle states X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=6151e822d3abfc2ed6c4b8780d7f6af20cccb0d3;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git PM: domains: Fix handling of unavailable/disabled idle states [ Upstream commit e0c57a5c70c13317238cb19a7ded0eab4a5f7de5 ] 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 Reviewed-by: Ulf Hansson Signed-off-by: Rafael J. Wysocki Signed-off-by: Sasha Levin --- diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c index e811f2414889..a64b093a88cf 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c @@ -2232,6 +2232,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) {