From patchwork Thu Nov 29 17:46:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 152432 Delivered-To: patches@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp2672148ljp; Thu, 29 Nov 2018 09:47:21 -0800 (PST) X-Received: by 2002:a19:4f0c:: with SMTP id d12mr1580633lfb.121.1543513641327; Thu, 29 Nov 2018 09:47:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543513641; cv=none; d=google.com; s=arc-20160816; b=z3I+wWMSXXpIZg4y3QLy45esWekKlxL1l2GbX7w23UhnQnMnI8bgSzWqLZTG9icC/E Jdo40NuzA0peWru3scAm3layhl4SHcVwwvMkwiFARLIPLlzNgpqiMIaLSXV63HkmOtII cjlBHAuzHHd/JNE5pnxpRx2PbB3QOFRXYmtt0Ojup9qUaS+lL9pbgW/5623NgZDSJ6he nw2Dc1vOeQRqI5eqFlCqHRHHb1F3zlC3S9AIe8RYot6FX5nevrWJIa5ppTfSRCm6yfp7 /2xrfoCHZ8zmy729TCCyVjYDIQJuK26Mr9ggIzOzm+3Oyb1EJNNlbecB/EdUoZhScB6F FTCQ== 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=GHVkWH3PSWyA/cWKlkRJqeV/OFZetQXn2GZtzBG/OUI=; b=i3XxZOLBWP3pp5IU4tkwB731PUaymdGqZ/48YrS2lgZoyrB+RXVI2gprdEDdPopLzs kMPe4Y9yrGJ38XeI3Epd1bnpqBFxuy29NwW3QS0KPKkw2GCwCv6Gv+w1Zht8ufOqIVyM /PJn6CzyHj90A5WFRpm3s0II6dAagmxNoQHH7B6hKzbJghJ5ZjPr/EnCyeY/KljaNG8q J5CXSi9bXf7KSqzJmp+bsmTW6QefZbWCKLgBBilni9zmlKZ81Ds4c+RrqbVOgy/osoaZ +U7TlGVJGeza3dEY5/JNjjJGTYCpczg9UtLb/qp8c2Pl6DCfqDpXmdVf6tS9Vl9pBXvA d9Sw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Bd0qIXUo; 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 m72sor799881lfe.8.2018.11.29.09.47.21 for (Google Transport Security); Thu, 29 Nov 2018 09:47:21 -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=Bd0qIXUo; 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=GHVkWH3PSWyA/cWKlkRJqeV/OFZetQXn2GZtzBG/OUI=; b=Bd0qIXUoNE817ai3HRpnThklH0wMCE/mlCss7tY0ZMJQu/RMVZP851QMoOYySBQEd2 mEQ06t46GXwZVqcrZtRsDj/admhdsTMjYhu6F8WdNMNgeuZYdXY+iLagQIw3oe87sTki s/tCdK3NWK58gBap3Uzx1VWgQBXoftGQryias= 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=GHVkWH3PSWyA/cWKlkRJqeV/OFZetQXn2GZtzBG/OUI=; b=bLrcoWgKCVeEWQAnOg2xZJXF0BYFko43Q+NrebL94Id/M5IFgDqLthUylKNsmFqwFc JlPJN8kDRx8jHMQhzWrBri7aUBvWKmByn5JnC3RLOa99Dk9YWD8cVOoFPSaHCYjM7x6y RsWBAZ0CSFGiOiHU8valqR9lUlSVuLSjw8kMhtXRxPw3mo72ONgptyOClR/3JWDgvLOc yUOLxbLYR1hWGvrrCszqIPD78/T9Qdn+TdIKGclCfDngVkUze3S3mQjkXLYn2UF+nWwc Qk+IMdOH/ounQmq7KAbgEyRykJTMhnDG3WJgJx6293FJvp1s7NlL6IYfnXniymTuEJR9 dgfQ== X-Gm-Message-State: AA+aEWbbY6xtlORBbIOwOeZt7X4UKLs49x8O5WrNlNDl8LJCSDnjm3Zc WCcScDjhLT2O5VnZYWEP6/OjiKWw X-Google-Smtp-Source: AFSGD/UDRbZWKmQpM2ZYNMWO+bDSpejpjTcM2x/gl7uSYN52LEkq5NFPz8ifaAHNr7UXis+YGI7bDA== X-Received: by 2002:a19:d90c:: with SMTP id q12mr1603187lfg.24.1543513641080; Thu, 29 Nov 2018 09:47:21 -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 j76-v6sm393983ljb.12.2018.11.29.09.47.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Nov 2018 09:47:20 -0800 (PST) From: Ulf Hansson To: "Rafael J . Wysocki" , Sudeep Holla , Lorenzo Pieralisi , Mark Rutland , Daniel Lezcano , linux-pm@vger.kernel.org Cc: "Raju P . L . S . S . S . N" , Stephen Boyd , Tony Lindgren , Kevin Hilman , Lina Iyer , Ulf Hansson , Viresh Kumar , Vincent Guittot , Geert Uytterhoeven , linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Lina Iyer Subject: [PATCH v10 07/27] cpuidle: dt: Support hierarchical CPU idle states Date: Thu, 29 Nov 2018 18:46:40 +0100 Message-Id: <20181129174700.16585-8-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181129174700.16585-1-ulf.hansson@linaro.org> References: <20181129174700.16585-1-ulf.hansson@linaro.org> From: Lina Iyer Currently CPU's idle states are represented in a flattened model, via the "cpu-idle-states" binding from within the CPU's device nodes. Support the hierarchical layout during parsing and validating of the CPU's idle states. This is simply done by calling the new OF helper, of_get_cpu_state_node(). Cc: Lina Iyer Suggested-by: Sudeep Holla Signed-off-by: Lina Iyer Co-developed-by: Ulf Hansson Signed-off-by: Ulf Hansson --- Changes in v10: - None. --- drivers/cpuidle/dt_idle_states.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) -- 2.17.1 Reviewed-by: Daniel Lezcano diff --git a/drivers/cpuidle/dt_idle_states.c b/drivers/cpuidle/dt_idle_states.c index 53342b7f1010..13f9b7cd32d1 100644 --- a/drivers/cpuidle/dt_idle_states.c +++ b/drivers/cpuidle/dt_idle_states.c @@ -118,8 +118,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; @@ -176,7 +175,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;