Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp8347263rwi; Tue, 25 Oct 2022 05:44:29 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6nb/W9etVZ/WdGB0ORC8SIJ7yc/Nt81YQle6xqX+vRd4asSow3inaU/0wpCehlb/YYBrMr X-Received: by 2002:a17:907:1b1c:b0:72f:9aac:ee41 with SMTP id mp28-20020a1709071b1c00b0072f9aacee41mr32445894ejc.56.1666701869138; Tue, 25 Oct 2022 05:44:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666701869; cv=none; d=google.com; s=arc-20160816; b=b4BZHb5Nzs4R1Mgki/iiT7UGIKsFPepI65ELNR0l9VkGSdfzKhdruOGdwyiHsZ5j0Y EgfgzHrcN4WSBj1iVqGmL1zGWmN/AmhAdt1vi2itA++ranXAuLHK4m0kjzKnh3kPHGE0 bjLvmi49kujgcSBlIBP9Y0ewORYMkh6P0EeBhXDB7cbgnkf7t63mRAmx8Sx/jt8pz6N1 +stLfulFEPeTmNVvYZNiSmAtGVJjG3j4QXy5SP158m6Bvb6h1yjSXjDjQq6EN2egjsIw niyMvCHS8Mo79f/5a4GFfqg9stK8Wt/uML2tFDUKJ03dji5ChtjoaiI8un6Pykic6Wyu vhpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=zTefL/O/eDGgRrrfH2rWXmnYYhO8HP29QBdKV3O55UI=; b=ynwTNQJ9hoFjp0MjGC/s5WSYIG+jkawC5aupjtn9FKB9IdJ8HqpYKmlFEnG7eLl1/x 0umk6tvWF+6Q/0zokijS2rnsTopS7AlteNKJ9UaOX+Gw7RE+16KIWXtUmwc0vkKKN2eb RhSzNX2/hcX5T93A5UYrpx+3U2zS4Xa+u3xD9wry6mBaUFkLRVv2R4bunlEchOQeIi6l OwTwNUx0V6FvvRgzn7VS+IS1vN3W66cpMpnohONSGKOXQYUFGWTgnVhvEV5JocwAYvXx 82L7b8S4d4kpL7izs7P84vmhowGUx2IrazJfc7+tIwlOHQwiOJqv9TTR5ppzaZs0BMkV D3Jw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cr15-20020a170906d54f00b0073155abc1b8si2919783ejc.154.2022.10.25.05.44.03; Tue, 25 Oct 2022 05:44:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231774AbiJYMem (ORCPT + 99 others); Tue, 25 Oct 2022 08:34:42 -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 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 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) { -- 2.38.1