From patchwork Wed Oct 3 14:38:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 10624947 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4BC6415A6 for ; Wed, 3 Oct 2018 14:39:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 39DDB28B13 for ; Wed, 3 Oct 2018 14:39:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2D7D628B10; Wed, 3 Oct 2018 14:39:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D2FEF28B10 for ; Wed, 3 Oct 2018 14:39:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727353AbeJCV1d (ORCPT ); Wed, 3 Oct 2018 17:27:33 -0400 Received: from mail-lj1-f196.google.com ([209.85.208.196]:42369 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726989AbeJCV1c (ORCPT ); Wed, 3 Oct 2018 17:27:32 -0400 Received: by mail-lj1-f196.google.com with SMTP id y71-v6so5342162lje.9 for ; Wed, 03 Oct 2018 07:38:50 -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=NdOVQOgn6QPfKNtGaQ+NXVIYYOcD0EuuWacQGnuhPH8=; b=WRWo6nk0nJa1hY05q+tQgr8xYnf2RAMUdfJAU1VKIlIychduM+cr+0DxYEisUldbgH +/Rt0QJ+NphPgxHDcGKI/myX65HaEuMqK3zWKyh4M0a9UZFtPkE7T53oOXkcZ4QqMCk6 1+HW35LznBwGCIspaeGz+RXntF71adUgghmqI= 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=NdOVQOgn6QPfKNtGaQ+NXVIYYOcD0EuuWacQGnuhPH8=; b=HFMCzegujcMc5wGb33ukkoArpu9EDUYuV4Yq4FKhLLD5TD6HV3FoJpUrICPtpP3nMR QgU5nTMszf1hLCyAvKJz9uxQzDxrpZQwDDAZA3wnTjqIIbv2/xzzHN5S8/zHq2Gsrx49 9z3sjBsAU5sPWOu3jcVHNl8Cywilj7bVP5hI6lDd9Tv8Ja5NHfNPQQqj3bCscFdRILVI 3vmrmq5AlmjIzdgYIJp+Wy5GuiKiBCegJmD2Sxd0XvsYtqC38mX3oV/KtlUM+3Spbrkv Q+pd1jNUc4VYKSU7y9xIBJqqeKPpyGeXuhBX3RSamZofa9iQrC0EZryQt2k5T1Mq/ErZ ZbKg== X-Gm-Message-State: ABuFfog97Z2FK9RsUc7RLZuyB3CO/VafX4+dJQCP66V/T1yhGNLyy9QN IZjeqRYYGqkKyofaqAQCD7RTlA== X-Google-Smtp-Source: ACcGV63AVZN1e1UHiciRJACevTU85s4dyI3oLi6l675UID00+PW7/sACBRYiDcjYfxt4IYXNSs8MVQ== X-Received: by 2002:a2e:591d:: with SMTP id n29-v6mr1383472ljb.70.1538577530142; Wed, 03 Oct 2018 07:38:50 -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 18-v6sm380867ljo.74.2018.10.03.07.38.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 Oct 2018 07:38:49 -0700 (PDT) From: Ulf Hansson To: "Rafael J . Wysocki" , Sudeep Holla , Lorenzo Pieralisi , Mark Rutland , Daniel Lezcano , linux-pm@vger.kernel.org Cc: Tony Lindgren , Kevin Hilman , Lina Iyer , Ulf Hansson , Rob Herring , 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 v9 06/11] cpuidle: dt: Support hierarchical CPU idle states Date: Wed, 3 Oct 2018 16:38:19 +0200 Message-Id: <20181003143824.13059-7-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181003143824.13059-1-ulf.hansson@linaro.org> References: <20181003143824.13059-1-ulf.hansson@linaro.org> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- drivers/cpuidle/dt_idle_states.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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;