From patchwork Tue Oct 25 12:34:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudeep Holla X-Patchwork-Id: 618627 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 41F7EC04A95 for ; Tue, 25 Oct 2022 12:34:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231748AbiJYMel (ORCPT ); Tue, 25 Oct 2022 08:34:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52174 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230469AbiJYMek (ORCPT ); Tue, 25 Oct 2022 08:34:40 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E4F99923D4; Tue, 25 Oct 2022 05:34:37 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id F15A0D6E; Tue, 25 Oct 2022 05:34:43 -0700 (PDT) Received: from usa.arm.com (e103737-lin.cambridge.arm.com [10.1.197.49]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 7F8683F7B4; Tue, 25 Oct 2022 05:34:36 -0700 (PDT) From: Sudeep Holla To: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Sudeep Holla , Amit Pundir , Bjorn Andersson , Andy Gross , Dmitry Baryshkov , "Rafael J. Wysocki" , Ulf Hansson Subject: [PATCH] PM: domains: Fix handling of unavailable/disabled idle states Date: Tue, 25 Oct 2022 13:34:32 +0100 Message-Id: <20221025123432.1227269-1-sudeep.holla@arm.com> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org 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. Cc: "Rafael J. Wysocki" Cc: Ulf Hansson Fixes: a3381e3a65cb ("PM / domains: Fix up domain-idle-states OF parsing") Signed-off-by: Sudeep Holla --- drivers/base/power/domain.c | 4 ++++ 1 file changed, 4 insertions(+) Hi Ulf, As you already know, this change alone doesn't fix the issue reported here[1]. It also needs the fixes you have posted [2]. Regards, Sudeep [1] https://lore.kernel.org/all/20221018145348.4051809-1-amit.pundir@linaro.org [2] https://lore.kernel.org/all/20221021151013.148457-1-ulf.hansson@linaro.org -- 2.38.1 diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c index ead135c7044c..6471b559230e 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c @@ -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) {