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: 10941587 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 5BBDD1398 for ; Mon, 13 May 2019 19:23:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 490FE2838F for ; Mon, 13 May 2019 19:23:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3CA1F28415; Mon, 13 May 2019 19:23:47 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id CFA992838F for ; Mon, 13 May 2019 19:23:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=fJdmelHuNS+H60mzqEmLLRCJeX1DpDetpmtXjXtqvdE=; b=c/mVUmDpZg+fhlna4UhQoc0IUk dqvbjy1KKPskaBbIVsl3aU02VpbmXLj9oLXBtJ1F+Q6koAy4zBk4kRBzP05+2XRZO3sFURbCft2Si xFR2SisJSJi+lyMx1FMkj2rwr5RBE0siGizRAOER+FuC5llAfoyWP0npkIqzeOg+eTAvW/LtFL7lm Hxca8Nbyesv59kav35SOs4r+QxW5o9ss267emgTRMbSt/dekz43s6Dbkxa0oXH9ntvb2+ef15H9Hx IKfO7yms8sYtf0bQqLaerWHYug2fLrsPwL9e8ncbyoKskXDjg4UFtGm7BNgnA67mOErhr5nzwS6cz CwcLtBqQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hQGY1-0001WH-BF; Mon, 13 May 2019 19:23:41 +0000 Received: from mail-lj1-x243.google.com ([2a00:1450:4864:20::243]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hQGXY-0000s0-MP for linux-arm-kernel@lists.infradead.org; Mon, 13 May 2019 19:23:16 +0000 Received: by mail-lj1-x243.google.com with SMTP id d15so12061788ljc.7 for ; Mon, 13 May 2019 12:23:12 -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=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=kPyBRSi7vh2skwpTURkJtYF7dyAqc3IoiNYMRlLKFFbBxT0r7ANGn1ei6Q6bQJwiTE bMwqwbtrQkK1TmPbpCUQ6R7X51gg9ugZmjJaul/mYnrFpwlf/6elVGcZ/Zq1ifKh/1bM UtZ5wzl2hBdn8LAZJNnR68BxS8PWaGBg5zQGOiEZcHq5DUOng9I9tCZfBG3DnYDpMbxE FJK7xGddMDFqVRQBuq8vTkCIatdC5atIUsSiT+BbA8m2bT8zZD/f97YLWWoqnnYoDtiR DyAFz3UrEKp1W/36mrbTZIZ8HN/Cr4pEEAthdozXzB0hVGohXvuWJbvSyCTwGPsDiXXv zjAw== X-Gm-Message-State: APjAAAUWMt6NZNZAzaZeXPPlpyG0yJKAtc8Gu+xdhKUNwLEHFIB5jXOY EMYtvpdohFvOgyNxmzPkp1nUZA== 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) 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190513_122313_052499_7C7C04C7 X-CRM114-Status: GOOD ( 12.95 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ulf Hansson , Vincent Guittot , Geert Uytterhoeven , Kevin Hilman , Stephen Boyd , Viresh Kumar , linux-pm@vger.kernel.org, Daniel Lezcano , "Rafael J . Wysocki" , linux-kernel@vger.kernel.org, Amit Kucheria , Bjorn Andersson , Tony Lindgren , Lina Iyer , linux-arm-msm@vger.kernel.org, Niklas Cassel , Souvik Chakravarty , "Raju P . L . S . S . S . N" , Lina Iyer MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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(). 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(-) 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;