From patchwork Mon Dec 30 14:43:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 182619 Delivered-To: patches@linaro.org Received: by 2002:a92:815a:0:0:0:0:0 with SMTP id e87csp6422216ild; Mon, 30 Dec 2019 06:44:17 -0800 (PST) X-Received: by 2002:a2e:7009:: with SMTP id l9mr39088881ljc.96.1577717057128; Mon, 30 Dec 2019 06:44:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577717057; cv=none; d=google.com; s=arc-20160816; b=qzZ2U7lwtvmBu7ipOvvPty7vxksxv1VYKHVdlnLxT+KU+NKNU6YAev/4dd/BhYlVfG BKDoyV/GtFx9XC8dNBPA/wgxL3ZB04C5wXnopJiond9QJdz/Up/Zma4630VDEmSIsufJ OU1cHEp73AXJPEcJ/38cW5zrEvhiSoMxoL6+wXRNDZgB44zUA3+5kznPyyVvPiWoZx82 u9eTx7NdIn1USBLyKGE40VP2vU6ghvc8cjMY73Dk54a2sZXBqREdbfI6bN8o6FiyFX0c FhwYAW9mC7nl5kUqVQLcynWZBwmBIGWyXLEmBNOk3iwbMNsSCqhktNwvbO99JdkmHBu9 IkSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=owx+SloUf8pds6VPSlJapJq+5ymBBPQ7iA/SKJJgwjU=; b=poT5pFlXSz4NcddEBLj4dD6ljDm8svEXTdckkKh80SJy6fEmyKaQRuy/G7hMJbmsrv BjwMkkTyLdnrx4Uu3/vK3jJGxVTvIpWiwLHCF+2ort7LmoSFoZJ/oaeeYSoq+/XZYu3T CZmnx7WMoWXY4HBBsWZUSkPv0qxQzjl+jmN9OqL6WOUmAcH3cEFvcJ+CoKjK9WZw1otW MglOu1hj/q7292kPCE6zX0mwrOdDYityFojRqqOHWOrIJK7mdSAfdhdpv6WyTrnwOxqO 5PeRFXc4mOWegCezM6ZAE12gWqBtuvvSGe89EoWjrFGM2LSpcu3xVkp7BBqtNBzenDwI +FAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jOMMern6; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id o25sor9673274lfi.16.2019.12.30.06.44.16 for (Google Transport Security); Mon, 30 Dec 2019 06:44:17 -0800 (PST) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jOMMern6; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=owx+SloUf8pds6VPSlJapJq+5ymBBPQ7iA/SKJJgwjU=; b=jOMMern6T7wiWE4/ufEPrcYPooLKd4g26VuETKc7rFkMRNBi7vRvt8RFhBr0UOWAnN wp11vcK5R9zGy6To03gCj2b0edl6KenBOw1Y+Jb4/Xv8ZSsYJBbEM/iOOcAndEOhUKDf t5WQq15GFK32RuJCD0MERQBiYIJz4eWhazo3dx3TlfMiVG41xKuXddbILMfHTxh9gzpj MQ64gwbw5YmhfRQDHZIZQzHQm7Gx93y0GfcirJquGCLKb31azdub1BUAwNDJhfvmnPwQ y1TQ1/1HmlOhpvbbHmNj8AVinJ+THuhmX6qe2QprHuwKGNVBuuPFIbtj7RLGpelLTurU VQIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=owx+SloUf8pds6VPSlJapJq+5ymBBPQ7iA/SKJJgwjU=; b=XstzxkWPuQK2EoKeTzw5M1ZcwG54fwEBCONdegdfROK63ocStLxuWHYXex1flCdckR Ly4KvV4R62KmX/6Ml3QSSFcHv7QUBAZG/pJ+rtLatkt8mKDfqytivspAQaxfuI82MZ1S OR15W0CIzMgn+m5c40cOxjixd0OEP5A6Uwt+I3tuzEnXMovfrX5ciDN8RPyfZGYXkp7b 2xTgxuPAtrvffSbSoUXRnJYCRIXVw6hhVS3pLGRieQiCjYlW7w2ziSqzBbaVN0dqI8S8 +BihCaue5hEFbK4uFF/HYkalEGU6wwTFjH51Exi479MdRb4rninN/XbNlcAdZkv7SyNc 6gmA== X-Gm-Message-State: APjAAAW46PrtQR86oaGuo0CVfgD1ysN7glhRGwK61aYcjkd1ffGt5Jly pL9SYJAPXMRFn20p1JPZXKnHmFqB X-Google-Smtp-Source: APXvYqxp/iitD6O/NdUA06r9/yZSgghJqfhQcVQLOvvXc32vodyNVAkq4131RInkIiKGlrJereqGvg== X-Received: by 2002:a19:f006:: with SMTP id p6mr37770832lfc.94.1577717056795; Mon, 30 Dec 2019 06:44:16 -0800 (PST) Return-Path: Received: from localhost.localdomain (h-158-174-22-210.NA.cust.bahnhof.se. [158.174.22.210]) by smtp.gmail.com with ESMTPSA id a21sm18744931lfg.44.2019.12.30.06.44.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Dec 2019 06:44:16 -0800 (PST) From: Ulf Hansson To: Sudeep Holla , Lorenzo Pieralisi , Rob Herring , linux-pm@vger.kernel.org Cc: "Rafael J . Wysocki" , Daniel Lezcano , Mark Rutland , Lina Iyer , Vincent Guittot , Stephen Boyd , Andy Gross , Bjorn Andersson , Kevin Hilman , Ulf Hansson , linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, Lina Iyer Subject: [PATCH v5 05/15] cpuidle: dt: Support hierarchical CPU idle states Date: Mon, 30 Dec 2019 15:43:52 +0100 Message-Id: <20191230144402.30195-6-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191230144402.30195-1-ulf.hansson@linaro.org> References: <20191230144402.30195-1-ulf.hansson@linaro.org> From: Lina Iyer Currently CPU's idle states are represented using the flattened model. Let's add support for the hierarchical layout, via converting to use of_get_cpu_state_node(). Suggested-by: Sudeep Holla Signed-off-by: Lina Iyer Reviewed-by: Daniel Lezcano Co-developed-by: Ulf Hansson Signed-off-by: Ulf Hansson Reviewed-by: Sudeep Holla --- Changes in v5: - None. --- drivers/cpuidle/dt_idle_states.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) -- 2.17.1 diff --git a/drivers/cpuidle/dt_idle_states.c b/drivers/cpuidle/dt_idle_states.c index d06d21a9525d..252f2a9686a6 100644 --- a/drivers/cpuidle/dt_idle_states.c +++ b/drivers/cpuidle/dt_idle_states.c @@ -111,8 +111,7 @@ static bool idle_state_valid(struct device_node *state_node, unsigned int idx, for (cpu = cpumask_next(cpumask_first(cpumask), cpumask); cpu < nr_cpu_ids; cpu = cpumask_next(cpu, cpumask)) { cpu_node = of_cpu_device_node_get(cpu); - curr_state_node = of_parse_phandle(cpu_node, "cpu-idle-states", - idx); + curr_state_node = of_get_cpu_state_node(cpu_node, idx); if (state_node != curr_state_node) valid = false; @@ -170,7 +169,7 @@ int dt_init_idle_driver(struct cpuidle_driver *drv, cpu_node = of_cpu_device_node_get(cpumask_first(cpumask)); for (i = 0; ; i++) { - state_node = of_parse_phandle(cpu_node, "cpu-idle-states", i); + state_node = of_get_cpu_state_node(cpu_node, i); if (!state_node) break;