From patchwork Thu Apr 12 11:14:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 10338381 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 17E1E604D4 for ; Thu, 12 Apr 2018 11:21:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 053CA287A5 for ; Thu, 12 Apr 2018 11:21:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ED802287D1; Thu, 12 Apr 2018 11:21:21 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI 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 67294287A5 for ; Thu, 12 Apr 2018 11:21:21 +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=HCVnpT9ll4dldtacrVbbLOjbNtBlqiTuYF6QB0/Hrdo=; b=a3gk7klQkUvdYWEbXwFiAAS9X5 ItpMVPa+AzlPcpV3RR1VgiE0SMHqnXz3AuC6uh1QK8PF2n+yJTHTx83o8fMP/R/iDVJPVrbkvm8jJ GwzZBPXNepdf5tS0er+wObT0dlnbF1oFloEOi9hynpd8nCS6mO+PT3izsdeHjrxlh7vukO/m+N1Sh XjlvTPflDSN7oIXx3VVKB9iCGFR991ExnDCRoyPYxMu7jsuQnLuCeNeBKuLrzxtH01YZtqmpjK39O IA2C80ndkipWM+mUYLBpKChyE6aJeukRIKJl9nIUsk5xNvChczpsun726is6GWy92lPPLMSr0JIxU q3zhBApQ==; 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 1f6aHz-0002QM-0n; Thu, 12 Apr 2018 11:21:15 +0000 Received: from mail-lf0-x243.google.com ([2a00:1450:4010:c07::243]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1f6aC0-0005QA-2E for linux-arm-kernel@lists.infradead.org; Thu, 12 Apr 2018 11:15:06 +0000 Received: by mail-lf0-x243.google.com with SMTP id d20-v6so7114235lfe.3 for ; Thu, 12 Apr 2018 04:15:01 -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=wNxOIumF5VO8wdO7axQyrg1Yf0ybJeBuC4ybXh+k+I4=; b=O8WhQWRGFjMZMMxvRJen+/XKvYxf1lramgnS/wOTD+s+mrxlzym3vrs4iggBF7XCk3 Z51YnM1Efs2PtSV8PwlHPzXmT2JfjZkpiXCnJlSdGlNP3wFNm7xbTZJ/hYuod6826Wqk r7i2T5YHCQyST5ZosDeSf4ozleHNcclvSZR0A= 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=wNxOIumF5VO8wdO7axQyrg1Yf0ybJeBuC4ybXh+k+I4=; b=VUPBCiyD/IiZGqlo7LVAUrSYFhdDEPgE0Ia1gyF+s5Ok/5BCrw5MFeyS42rIne8nwT nIvbGA/beQ9T0ct2urBs2ATZPSd3qh4fCuiAmUsl8QAQFTkvwnUHFGw7E/T8Ta3qqiPK briyXM9k3tPH+7LSzAoAATtK48zTsy7ZFdmEqWr3uETU8QV7ZumrpldRrk2sgbSEUSMw 3/gg2yAUO4YJh/BSAeE7Djkr5IHRujoS7cKMJvN4JjQm4zDpT8sExJHy8bvxVAqUiooQ zIREwr0S81okfuqkDwGq3SL4GZNbqshchwnnnzJMPFyRqYfrikLNwNjcMaEVCyWgiAYG o/kw== X-Gm-Message-State: ALQs6tB/LhlNXMtsLSX19gAvQhp+gIgrB0sHbV+bz5L5OzG/Erq/GrVe gYTyNJoLDiakKreqLcnPFBWFIw== X-Google-Smtp-Source: AIpwx48GaNnT5e3GV0a9rQWEJscn1nPnaNBvVRYAnMX3FRt/15zQ2JdYvvA27MWv1/axsn2WI6n0Ew== X-Received: by 2002:a19:1122:: with SMTP id g34-v6mr4714707lfi.6.1523531699615; Thu, 12 Apr 2018 04:14:59 -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 r29sm543187lje.72.2018.04.12.04.14.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 12 Apr 2018 04:14:58 -0700 (PDT) From: Ulf Hansson To: "Rafael J . Wysocki" , Sudeep Holla , Lorenzo Pieralisi , Mark Rutland , linux-pm@vger.kernel.org Subject: [PATCH v7 12/26] cpuidle: dt: Support hierarchical CPU idle states Date: Thu, 12 Apr 2018 13:14:17 +0200 Message-Id: <1523531671-27491-13-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1523531671-27491-1-git-send-email-ulf.hansson@linaro.org> References: <1523531671-27491-1-git-send-email-ulf.hansson@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180412_041504_268650_DA3A8E65 X-CRM114-Status: GOOD ( 15.24 ) 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 , Juri Lelli , Geert Uytterhoeven , Kevin Hilman , Stephen Boyd , linux-arm-msm@vger.kernel.org, Daniel Lezcano , linux-kernel@vger.kernel.org, Lina Iyer , Rob Herring , linux-arm-kernel@lists.infradead.org, Thomas Gleixner , 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(). 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 53342b7..13f9b7c 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;