From patchwork Mon May 13 19:22:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 164052 Delivered-To: patches@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp1728220ili; Mon, 13 May 2019 12:23:11 -0700 (PDT) X-Received: by 2002:a2e:9848:: with SMTP id e8mr2873287ljj.27.1557775391481; Mon, 13 May 2019 12:23:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557775391; cv=none; d=google.com; s=arc-20160816; b=0Q8j3ES/hwGm8TWfGmOXzax1t1DDKM2vpAknZw6CLrNiulPNjwvpH5mmCERr522dM8 763VUyT8feOmaF7/N4KMyL9DnAYUCuaCMRdzFp7LtBk9OtewCKgMp4fUnVBao4IpgBco CBFbKAofQwzo6j/7qpFHsh6/P1LVDl4TrJyGeAR539Pl3oc+EN4YmnI4FCGvT4VetN00 WMWBnWYiqLYnxB7mJmOqRP+WoRqrILzT31YqkI81l/8kcs8LTSTIn7wK4YV3t54EgGUv b+/DlYw9smc+/rc0hcpo+MSrzeZGJCWOMRHWSSUDuyyzROgH+qH6bK0tDGoTnMyelCkB k2FQ== 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=F5AEltUKfed5w7dHNisHSX8S1wBzU63rf2dZ2cHwfSs=; b=Wlj/osf8eMm5HL+Zqgwebd0A4j8p0g557QLppTqBT+ffs5ZBdumE+LVnGb67rlnyRn UmrFSJF93qJyqrUF7QDcWwmpa9ozzLbkc38RZm3gQ0OYCIp9wZZUipngW8Mxupj17eTn HkIKlAdP5cl/85IWHEfzM8xE3TtGS3uy7wTwv8ztxcaIIseFfOZtJx2XTFVU9oUtTu3N lmB/WL8bHPr/44m7JhUYomiHVFocbUi0HboXWK1v7Gh8JkKp0mhNbM30lDcYFTxNqIHb 9k6/HhY3fC6TXRfqWKJ+JhhYtDzF79WTGYYP4VYsNUZnUE8IO8UaCILnF5pHfk0mUvRM Od5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ihwtaKGH; 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 w16sor2197354ljg.41.2019.05.13.12.23.11 for (Google Transport Security); Mon, 13 May 2019 12:23:11 -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=ihwtaKGH; 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=F5AEltUKfed5w7dHNisHSX8S1wBzU63rf2dZ2cHwfSs=; b=ihwtaKGHm5HWQDkvQkty6/m7be/aDE2Ue2EF8h2aUL7J5q3dbOjBQl/7riCd7391Bk 6mt4yavZncehbr1dqBkKzd5+XE6F5UVYInUI/aMbhArbPszaqyttf3MVOOEailuYdP3R fucpydZkU9Xe7taVXR0KfQZCmk+WPepu9Fz5czOMEkZzxq0cyv/O9xzdwPbelTwhxiAt AgLFcBQz4OuHsSIHPRYM79Mx2eXRaijBK738WDXPRnaM8wcxzwaXGNHAtjVqh3N6NVfn PALPweQK2a7Hw+qtF1599CtdwmhaZJP3Loxm6jMlG87c2/LPW1b4sxzN22fBdrGhOVkv xgGA== 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=F5AEltUKfed5w7dHNisHSX8S1wBzU63rf2dZ2cHwfSs=; b=DeDrjMtyHbfAsCJbjZskg/KuAq1JjAIfmprstgOEF708pFEi9n/cajxzjALXVH3Ilz 8ibl8crrqDU0OKXXdwAwE/jywJHDL004pC5vDzaIEJIgmu0gUOqG4Ywuto09W1EBTGtG wF30IjbQjcA3caOGujlYRVxiKYWLCda0kG+C2IqfVxCuOvwvim4nx2JZr0uCT7x/DP3a GIdYAHhXCZfy75Q++cHqFARCc1fnhnRipwEYjNTbY3KXNmokWpc2Bc7r9pnaxtz7qEDn DlMFbVdfUH4DVZsBFk17MuoP66ONCgKNM4xiZEPDUfNPP2tDeM770k/5JaOF23efvsPr udEA== X-Gm-Message-State: APjAAAXZnGH5662SzKkZUIGRNqjcctBiO0bbtrqKIIqFscwRd4lGtDdL fLH3QZguwhYxJiPaEYlgo25fv8Xw X-Google-Smtp-Source: APXvYqxS293Cibnm8BvM4OA/7mePaZMMHGVjPn5T9aLCXEe34R5mqSI/nCjgK/Ib9ssZWuTZNP1Trw== X-Received: by 2002:a2e:c41:: with SMTP id o1mr8693546ljd.23.1557775391156; Mon, 13 May 2019 12:23:11 -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 q21sm3449365lfa.84.2019.05.13.12.23.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 May 2019 12:23:10 -0700 (PDT) From: Ulf Hansson To: Sudeep Holla , Lorenzo Pieralisi , Mark Rutland , linux-arm-kernel@lists.infradead.org Cc: "Rafael J . Wysocki" , Daniel Lezcano , "Raju P . L . S . S . S . N" , Amit Kucheria , Bjorn Andersson , Stephen Boyd , Niklas Cassel , Tony Lindgren , Kevin Hilman , Lina Iyer , Viresh Kumar , Vincent Guittot , Geert Uytterhoeven , Souvik Chakravarty , linux-pm@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Lina Iyer , Ulf Hansson Subject: [PATCH 03/18] cpuidle: dt: Support hierarchical CPU idle states Date: Mon, 13 May 2019 21:22:45 +0200 Message-Id: <20190513192300.653-4-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190513192300.653-1-ulf.hansson@linaro.org> References: <20190513192300.653-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(). Suggested-by: Sudeep Holla Signed-off-by: Lina Iyer Reviewed-by: Daniel Lezcano Co-developed-by: Ulf Hansson Signed-off-by: Ulf Hansson --- Changes: - 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 add9569636b5..97ad25399ca8 100644 --- a/drivers/cpuidle/dt_idle_states.c +++ b/drivers/cpuidle/dt_idle_states.c @@ -114,8 +114,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; @@ -173,7 +172,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;