From patchwork Thu Oct 10 11:39:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 175754 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp2163036ill; Thu, 10 Oct 2019 04:41:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqxvaRGwg2zmEU/ck7gG9Wnv10/41QTvuBH80dCrzxYIaxXQYLMU2w9MzZ26OMi4QyYcWCnY X-Received: by 2002:a17:907:2118:: with SMTP id qn24mr7521246ejb.141.1570707616598; Thu, 10 Oct 2019 04:40:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570707616; cv=none; d=google.com; s=arc-20160816; b=zLl3teqBEqwoeyvEm7kfRu9mjxYeCOC9N/+vtUaSPs5XLcpyUAuCsF2T6RrTmAXlOE KCuyPhP2FwSmNVWp3WRKob9ibYAjtPFEOHRTU2QZILRCktVvPiYrxUv2teXm90mII3fb XLYY6vWK97x2A/yLm2YOQZruJUF+6knUaS4KDwTfZ1F5pz2j7H0yzLhBwT6n85GA1ovQ eP+mmY5M0TYZP6PBkc9sRcYHSTSj7MQVUDALwjS1c2ILqnJyY0PSEUNGF83UQbwqCr1R zqPfswQuIutokOVdNulGiYhNfiAVV4JtmkcxMipmFtH3guAamGVFZGZAbMGSNPtERDex CWhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=uPQQL2LvieO3hRSdVOoT+soulZMhG9ActuEg4qQLyaA=; b=Lup5kd1CqvFMfkQGHfAhUmR1e6Am7v23XCrPnXSrluyWteJiy2DnzRU0melMnauQBg g2UR/CIyHauRBHtz5KOyNow/rybUIyshRb20fLCWU9gARhJdWuyCVok4xMAawUZH4Zwn 0DNEmOdTrREvCnlF4h0iba628/HP0eAzIGFTgra5rNimjWHZ8c658u1HB1ZYi1dEaqsZ xsIYBe2kgLAIdrfXd6NjotjWR0AnH4D+oDOAa5qjoJYczokWhYc0wbcUIyZ1ADexN/tw csUmXc1forqkF0QdeTZL9BhEO0IoUqkLD5xpdjr9RA4i7kGS131kFJkb03EBRzDP3awp W/Tw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=T0nFsd0F; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c60si3016856edd.327.2019.10.10.04.40.16; Thu, 10 Oct 2019 04:40:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=T0nFsd0F; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731230AbfJJLkP (ORCPT + 15 others); Thu, 10 Oct 2019 07:40:15 -0400 Received: from mail-lj1-f196.google.com ([209.85.208.196]:43879 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731916AbfJJLkP (ORCPT ); Thu, 10 Oct 2019 07:40:15 -0400 Received: by mail-lj1-f196.google.com with SMTP id n14so5809932ljj.10 for ; Thu, 10 Oct 2019 04:40:13 -0700 (PDT) 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=uPQQL2LvieO3hRSdVOoT+soulZMhG9ActuEg4qQLyaA=; b=T0nFsd0F5yhLoTBaFcw7y7TSJ7swFLFrCm0iZ9fxXkpwH6LgoqyNcmtnY+mHnZ7wqA tzclaFDIjVJeRj4TRzdNHxas/7Vc8CSCkhEVswvN1U/GYZXItT1Dooz0x75Gut6BZJwe 4S12SRko6dhQUiVAR7mIGBsqkpltXwc+NMvmdHK8upCiNxXR8JCoLhsHRJqg1TNG15Iv a8dMDov2BYDB7gaiCVsBOvN3bHHR40LV7UsV9TRjpeuPT4Ri5Tw3COGyo494xPZWl7xQ Q9jZ1l0HBJVKHFxRnUwvZuXn9e9UCxKzqe6oBIidHY+cpmTeJzdcMO6Goptv3Oz/YpEU VJHQ== 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=uPQQL2LvieO3hRSdVOoT+soulZMhG9ActuEg4qQLyaA=; b=D+POr1ecRLAUScrKdX5RkbadKHMdI/G2iLTB+aNF+DwMx4gpSFMQ/22dlYA8MbgGcD DkN6d3tak2w8k4hrvCEFJmwmDlFfK7vH+2jAFMugSZ1+hC8zHRdhDPS1Ih29MEy0BcJm AiUg3tbi+PXi/ViakPc9QPhuyCroNYk7HbJ9QAeNwBjEfeIZ/TGKdd40MNS+szLIvXto XV2yKZEpQS50PG5wEBSDhPmtzX4GlqXW2Y7Dn1SoFEOAnMQ7zfduMexRKF8ZA0teTo7+ RCdmxJZSGImSCsKNqJkaZ/7y/hGxGoSf+prv8qKMjvQi26g7pxWOK2lGm+zk2PMQ0pkr IDjQ== X-Gm-Message-State: APjAAAVG68VJimT+BQNqltQAnEhRGus9RptmsNMEHwIII0BZpai7eP7E QWDBxjmMHAlsOTJ9MQyRNfq09A== X-Received: by 2002:a2e:6f0f:: with SMTP id k15mr6301625ljc.12.1570707613211; Thu, 10 Oct 2019 04:40:13 -0700 (PDT) Received: from localhost.localdomain (h-158-174-22-210.NA.cust.bahnhof.se. [158.174.22.210]) by smtp.gmail.com with ESMTPSA id p3sm1168937ljn.78.2019.10.10.04.40.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Oct 2019 04:40:12 -0700 (PDT) From: Ulf Hansson To: "Rafael J . Wysocki" , Daniel Lezcano , Sudeep Holla , Lorenzo Pieralisi , Mark Rutland , Lina Iyer , linux-pm@vger.kernel.org Cc: Rob Herring , Vincent Guittot , Stephen Boyd , Bjorn Andersson , Kevin Hilman , Ulf Hansson , linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, Lina Iyer Subject: [PATCH 05/13] cpuidle: dt: Support hierarchical CPU idle states Date: Thu, 10 Oct 2019 13:39:29 +0200 Message-Id: <20191010113937.15962-6-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191010113937.15962-1-ulf.hansson@linaro.org> References: <20191010113937.15962-1-ulf.hansson@linaro.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.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 --- drivers/cpuidle/dt_idle_states.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) -- 2.17.1 Reviewed-by: Sudeep Holla 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;