From patchwork Tue Oct 29 16:44:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 178036 Delivered-To: patches@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp51844ill; Tue, 29 Oct 2019 09:44:52 -0700 (PDT) X-Received: by 2002:ac2:4345:: with SMTP id o5mr3170627lfl.60.1572367492286; Tue, 29 Oct 2019 09:44:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572367492; cv=none; d=google.com; s=arc-20160816; b=a1fcxBdVlx9L65uuJeQLsNmXWTWKnl8G1nX4XnZZ28fwrHntD0SP1ttLt9kycqqI55 e/ozzgItsDGMuvKv4IYM9Wnmf67eI+AqV6IwtRXwPncpihsfFy7LL9oq0liSqcWCJEld HO+VMqRJtgpggK3ahZKr1aNHE5ULc8W32hoSXXo7ePzBtRoE0qZdM9XtC6c9sBM9HCuc d4aOGuIXQMbFfNI7v0VUBkOP++eWMtmacADmMcPCtg+q0vqd/RPoLmc064pvwnaPgNMW 5BGc+bjjU98RG7Cp95VSd36K4Y4u9FgkIrNWbE5EagxRWT8ib96OmOPe4MHSTOC5Ojbr xX3A== 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=ez2utYAtjrFLSHNrrL2RvE6Z5l8CFOmyZBlsi6wZqI8=; b=qBdliMWt52DFPCmwffJ6ZIurIikPfedcW1qWPisKEZm5gkOkt8zyLcxujGBfAccBg5 gkJJDSA1elZHQL+dvec9zN8KIkN5MjLUp+//tmphwn6MoUhc8fK5ox0ULxt6vavRyWtj mDJZP/dlERK69EJFVtgYJ5abKvfnjkbOJebaqYpJTaEej3sW34/XOrMAgB3q5be3m1IS u3FgzxBn1+4vT0piAu0lOUWf/wN9Rizcjr0amE8rLC4BSlKcEDpMiqtkgcsrzrlQuSQj Spds3AOcaXGU0NpkOwSGyBSHw64r4zRpdNP/qyMRWVSXDyJlOwJcgiMkVAdmjHhYHWpr fl8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=eCGaQk2C; 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 n19sor4027012lfl.32.2019.10.29.09.44.52 for (Google Transport Security); Tue, 29 Oct 2019 09:44:52 -0700 (PDT) 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=eCGaQk2C; 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=ez2utYAtjrFLSHNrrL2RvE6Z5l8CFOmyZBlsi6wZqI8=; b=eCGaQk2ChyJ/95Dayhp/eCVH9GYp8vqXLGYdKqn+s6sbEXDtYLqRbzL7MikO9jQwyb NSWhHLVWes+HJoe8km3MiXNurD1DIePI4IWhRMUJBpByb2QW+HnOwvhkWFffVUwo1qqE 74g+X6ot4NazRXExIRE9h6nF5bDA3m6jHXT5deC0kDgH83ltRxgW2Mafp/I7qfrbwGec BZci5DBOypZIdRKtHNqIhasuVY2HvSsYaGEQVgReO9iPipAlWPN+I5faeOai7oGtGJa/ 1xlmHTo7sf0GTQml9Crhr1W0TtwNUr4qnjdFhNspGAPBO/3t9kbe6mGFB2FCR9QjWZRe /jVg== 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=ez2utYAtjrFLSHNrrL2RvE6Z5l8CFOmyZBlsi6wZqI8=; b=gI4u7/eVYh0akXuZZic7j3EIwnE3WuFcTK7EXs1ETeqs1tTN042/d3ELEVD56wTFZ4 GtN+g3TI0H0OupVcHRZSKwltgm8Zh4rmLN2UuBoeKgcJpziVlR+b7z+1PxBtPngKUgfn RRbF/yZVsI7BAyuQ1ZX/qNmYnt2tHPl4Hp3gzQCE+luNwvTHGIaDMvhSjljkP7MyxXMR TC+2sSGBC0t4z1vgZzI33viWtSLrji6LZnGAMSrjVUaI8IjGbaEgGw5gdfGVRXfLXlyh NIoRgCtqNJgIte3nyo1orvMPDJhlq42yqGWcRpQxg7dodoXIMOTG3XncdCoSs7tB3R4w S1Pg== X-Gm-Message-State: APjAAAX7eE8iUbQcFAOOYTZ3BODoHvFAGuRwZ4cKaSd/fjuKruXAGxhx jTeo5ZnjhyxImk3O6Na3Yd0SM0yx X-Google-Smtp-Source: APXvYqwG093vCEUK38BuHysHC02MT9Ew/IBlJLhyuhJziPLSFaU9E7tosCpzLO3LqiexNq1Pnlj3zQ== X-Received: by 2002:ac2:43b6:: with SMTP id t22mr3275250lfl.126.1572367491899; Tue, 29 Oct 2019 09:44:51 -0700 (PDT) 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 f28sm2048161lfh.35.2019.10.29.09.44.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Oct 2019 09:44:51 -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 , Andy Gross , Bjorn Andersson , Kevin Hilman , Ulf Hansson , linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, Lina Iyer Subject: [PATCH v2 05/13] cpuidle: dt: Support hierarchical CPU idle states Date: Tue, 29 Oct 2019 17:44:30 +0100 Message-Id: <20191029164438.17012-6-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191029164438.17012-1-ulf.hansson@linaro.org> References: <20191029164438.17012-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 v2: - Added tags. --- 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;