From patchwork Wed Dec 11 15:43:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 181269 Delivered-To: patches@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp701699ile; Wed, 11 Dec 2019 07:44:00 -0800 (PST) X-Received: by 2002:a2e:84d0:: with SMTP id q16mr2505331ljh.138.1576079040300; Wed, 11 Dec 2019 07:44:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576079040; cv=none; d=google.com; s=arc-20160816; b=1CnF8ogDLyZS/UotB3xK6d49lUbMI9KMJL6mDwW3ZsJWJXXobKDpBGqKbofM97wdLK k1B+n4FlLL8EExoYl98WoCN2LPZnOsfgz+DeU2plR6yDf2bPgxlJjuz+swmnKJMnIFtZ XwpON8PjmbJv4pvF/YuSpGgs4tJ9xnbSwIvCj7mcO7+pHubEJGMkmmXhtHft4tkHF7b7 lS5+oSCkY18zRKwhYpe5NnBEYGabqaDYfGxaRUL4bziNnBK6Yk/WfAZhNarOwGY7dMrb I+Oh8wPu+6agcRehenik2lmIBplu/nORrKPn0yaFnjyWZW8hhRVXmkqbKOxKJF6dbdUB Rx4w== 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=Z3dFHMSTWmknhjBa3X9neiliLOt0Ua6IMiSdXiMVvsE=; b=N8yYTFxzrRTfxsRjtqpWznRFG4DVoB+jnnQlMx4bXMW6/8WmAgGs7T7iTmSKddwRV5 TT5rx5eo9dZFklwyOk28Hq/wnHqS9ifHx96bQreO1Z1iS2ldhu+13t5AuePX54y418Qv 6h+VpEu3UNkNqxtkqm52VoFkzuknye0CFEpRX7hvHcPhEBjrodKhykJElfqz/EGGUsru hN9QbB3Q/SNSxNsAqxM/F3QtVoKqWEppy0i1YbpoDtLxmGoXlmOlnhxub+EHGhASFvY1 hQfTpQAvGCDOS7C6NINnbPdexduBaxZH9shRsh8wFX2Ivn+GBcEx/rFR66qV9tmkWzMX kaVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wcpag0kF; 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 o68sor852465lff.59.2019.12.11.07.44.00 for (Google Transport Security); Wed, 11 Dec 2019 07:44:00 -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=wcpag0kF; 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=Z3dFHMSTWmknhjBa3X9neiliLOt0Ua6IMiSdXiMVvsE=; b=wcpag0kFqzXeqRry8Pg+EjTlMzNiSVaOfpgd2if+zbTIxT2iOgTP4xyZQYDC8Bs6dB Zluu3yKQ0PKtJnDpD55xA3itb23Jn9Sp2je5wAgwp4H+0HY2bMJk7/6Ipq8dh1R89DaB n1URhE+ohyGVs+jgVRNadHhoHlebRHdIPN/V7BI6SBWKO2DYO8RdzuvI75pXdvqpvhXz 7M5kOfABGVvXfaD9+Bldd012eFKU3iv0n9b8VLjttNt5N3LN7Z5pBKEB8eiFVpTjae0r FYPzg01HomARnv+j/Tsl7qynJqgHED4aYsx7ALVvAkIb5SElrIMAY6qA4fQ2A2d3w9tt tWmw== 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=Z3dFHMSTWmknhjBa3X9neiliLOt0Ua6IMiSdXiMVvsE=; b=akZf5of9yfwHMGZUTsFX8BV3KbL50ZPfQnZIPVT8EvdsGmoWlFHk089BgtNF2xrDKH aiO2XRhufhisyydyfKx/3RxHGJe2u+SqJBbkn8wD9noiC0Rw52s9OMMjsrBFVhcp3vbW 2xPP2TaQ9TlmuZOnNyUG+LyeAQoY0jevrvzKrcFzMxWM0SL3oj9M+1ltoCzBSp19e+dV MASOEUjZEMCvfTG0pn6f4xtzaStvHOA150mtSNXrim4Okf4Eg0Qhq1xCILErmbxY7nN6 ORi2aMo9gOGMyFFqR4DDek9vQnA3X8c/aFuKxqlmUeJnYd3IL3Py+96TJRGwHbZOAwqv ZYCw== X-Gm-Message-State: APjAAAUOlEtXMFw1h3yW0YJpAQCBJso5ROXaNEEdPH0wFYkluTgG/adQ k9+mklRs5nQWPuL6Wwobsi2yNGA9 X-Google-Smtp-Source: APXvYqybL5yW0+Q8vqmaFlpbiu510ZmXk7dCEaf5C5AYnxU+6bSbBrEJxJrKmgsFoRB3rc4iE6TC2g== X-Received: by 2002:a19:5f58:: with SMTP id a24mr2699587lfj.9.1576079039918; Wed, 11 Dec 2019 07:43:59 -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 b14sm1389608lff.68.2019.12.11.07.43.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Dec 2019 07:43:58 -0800 (PST) From: Ulf Hansson To: Sudeep Holla , Lorenzo Pieralisi , Rob Herring , linux-pm@vger.kernel.org Cc: "Rafael J . Wysocki" , Daniel Lezcano , Mark Rutland , Lina Iyer , Vincent Guittot , Stephen Boyd , Andy Gross , Bjorn Andersson , Kevin Hilman , Ulf Hansson , linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, Lina Iyer Subject: [PATCH v4 05/14] cpuidle: dt: Support hierarchical CPU idle states Date: Wed, 11 Dec 2019 16:43:34 +0100 Message-Id: <20191211154343.29765-6-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191211154343.29765-1-ulf.hansson@linaro.org> References: <20191211154343.29765-1-ulf.hansson@linaro.org> From: Lina Iyer Currently CPU's idle states are represented using the flattened model. Let's add support for the hierarchical layout, via converting to use 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 Reviewed-by: Sudeep Holla --- Changes in v4: - 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 d06d21a9525d..252f2a9686a6 100644 --- a/drivers/cpuidle/dt_idle_states.c +++ b/drivers/cpuidle/dt_idle_states.c @@ -111,8 +111,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; @@ -170,7 +169,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;