From patchwork Wed Nov 27 10:29:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 180286 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp5914527ilf; Wed, 27 Nov 2019 02:29:30 -0800 (PST) X-Google-Smtp-Source: APXvYqzp4IzeuhXKIXm678SWeOw6P6GIJ2Ba220ErESfhpW9tLbJ4mrRg2nRq6ExhAb310vED34E X-Received: by 2002:aa7:c6c9:: with SMTP id b9mr30942453eds.1.1574850570162; Wed, 27 Nov 2019 02:29:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574850570; cv=none; d=google.com; s=arc-20160816; b=r9DweXxXCQM7JRGpV62+3Yk01M0Ky/NyI+dRewZNO9LNrrNBuhW9dZ+840X5TOuV2P lFyRr+K4Ou1v5lGQHZNVPaA21auShX2PV2xWLJtFSHxzRIB2HFKdSn1Bkz4sK75NunXm nYEAwYBp/FpVBpaOZzdFr/fXuJskzrOR0RFEG9JuzLGog8sOjQj8BXJV6CR/h5wlqdNb C8DtDhBg79R+f1I84kuYPrsEdgq/xXj5YUSw2UusoXuCicBwkUTA7WSIGYFmSo4gnlsa yrBuRnaQVJqPchz2qQs36y3XycovIsU82UnhdapnhK7wSZW8GgNXUgkOlgIC3hmvKyiT rvRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=r6EEdyR4M7hIjNiPTtCqyqL+HPCjuTmwEmLVgwUWsTU=; b=ycL7kOCn40HhZUEuvSbIS/4D0gxc7ltGAG5k3n43ZbGBuXQkPYpCJs8Ikk+FNnOFFK FmHIRWIolpn85AY0J0oBPddfju0b+TLgINgwY8mXXElRxfRnFpPoVPX5fPyAkjCg/9Ut EWGVDK9Gk/c4i3NPHRqlhfsgVPsaAZlYnvLKd3otGkoo20KKj7J5GJh99cwgiiJf7Juh biDX0w15DfCG8NmtVujnYVgbvovi1XnTooz/dk5kEPoxQc68NC/qeQbX0azJIOHtHz3z 2HKbB34D+17lCVVE9YgmHyXKvINVZ1eAzFBer7OX8Giml5OKoGx6efpTeHrwJCrwlxiI uZ7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Aip1jwmE; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p24si8751899eja.385.2019.11.27.02.29.29; Wed, 27 Nov 2019 02:29:30 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Aip1jwmE; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727118AbfK0K33 (ORCPT + 10 others); Wed, 27 Nov 2019 05:29:29 -0500 Received: from mail-lj1-f196.google.com ([209.85.208.196]:36885 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727120AbfK0K31 (ORCPT ); Wed, 27 Nov 2019 05:29:27 -0500 Received: by mail-lj1-f196.google.com with SMTP id d5so23865758ljl.4 for ; Wed, 27 Nov 2019 02:29:26 -0800 (PST) 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=r6EEdyR4M7hIjNiPTtCqyqL+HPCjuTmwEmLVgwUWsTU=; b=Aip1jwmEw77XvaXpoL0a2PBc9sDNiZm0UnDB/ADxUDwNIdVBCF2fbWHwfRbLBh+J/f rNrtGsubiNSfVnOXDIWZxJI5cIfoHXYOsf2tU/Jp6JogK4w14ZwKmJrcTOT3i2RGsDsV M1la93McdDg0aO5+NKv0TLCjde3s6HRBOmsOITA8BHF5EtqF1v3yWPqU/ti7tNNznW0P /LUD/N322Ey8nbLpdeNyUCiu9IzUItBdR1Xq6E/MlfJ1NJIcymH8YguzuU7RhtgFoB7c kjswnEdVZx8pNx1lGAECS7NzZOznr2GSXxds6fBP0oSdXyQ6S8vb+mSpSTKtsJPQH0bZ MK/Q== 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=r6EEdyR4M7hIjNiPTtCqyqL+HPCjuTmwEmLVgwUWsTU=; b=UTqbtBUrgnv3FW1c05ykAkP/G3/SpDnNXGq6mUy6sLJZymerFIcIOIwF23mCY6wO9r oUFlxqAzolTIP/fNLLIEWlyW2LklYvlZfAgsHcqQeBgZ5ALQydXuM1XcdWaU23qcPfIU uzza7fz1UuI5s7+icEJMFCvB/dra3mSsdwTdzkH1ZetTLVOSFNFdTtXfwEg4BxCPDkYz A1AwlTUjza8ejJGLFsuSa+heMSSmTrJRD4VBs+yVj8j94XZShay2Ul3QljZPOXwWBl6k yowyk/tnjWD+LLa5X7EqsFQIHJ7JIg+cYfUKxvwpa15thHjBH6nJBiTt7Ljndh/mJESQ W/hw== X-Gm-Message-State: APjAAAWRBIs2sy06UFTdHMubWU5iP+NwcpQ+6bXevBZ+QX/fCV7TWKP3 dfD/NWRK5PTqKfGVUBPY09hlFg== X-Received: by 2002:a05:651c:c4:: with SMTP id 4mr1316779ljr.171.1574850565883; Wed, 27 Nov 2019 02:29:25 -0800 (PST) Received: from uffe-XPS-13-9360.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id t9sm6868260ljj.19.2019.11.27.02.29.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Nov 2019 02:29:25 -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 v3 05/13] cpuidle: dt: Support hierarchical CPU idle states Date: Wed, 27 Nov 2019 11:29:06 +0100 Message-Id: <20191127102914.18729-6-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191127102914.18729-1-ulf.hansson@linaro.org> References: <20191127102914.18729-1-ulf.hansson@linaro.org> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.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 v3: - 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;