From patchwork Wed Mar 14 16:58:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 131681 Delivered-To: patches@linaro.org Received: by 10.80.210.197 with SMTP id q5csp410544edg; Wed, 14 Mar 2018 09:59:25 -0700 (PDT) X-Received: by 2002:a19:e511:: with SMTP id c17-v6mr4185885lfh.106.1521046764937; Wed, 14 Mar 2018 09:59:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521046764; cv=none; d=google.com; s=arc-20160816; b=SIXp3Wmo21lnbpHJQCMoXWmCMi9g1S74BhbJ9u03A+r8kUrhxIprl93guSlMT9oIVw wy7Ug8XiaP8ojQmSwLAV2EvasDbaWyTxAb4sk5KsZtGQU2U+qJLrubzauf3g6MDgR9Ca UMyX/8g03V7y38980tcpeTzeXLEulU4SlkdJWU8DYdQoxtUDJ8qL8l/juOSmJ3uHi7C4 4oTS7LKq0v3vbP2TOD2htKYTX4hH0eNP9WICq9hmp0t54qwbBMbOoXl8rECZJoSz9mIB qkvaLIOW0CTw6X8R/9qR3fUUIaFeR+8OfMDk49AerbfivPxgRl+CCkL6aA7lrztRM4mc Tcuw== 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:arc-authentication-results; bh=wNxOIumF5VO8wdO7axQyrg1Yf0ybJeBuC4ybXh+k+I4=; b=p727qCnTGOLdjJXf8BccG8zlHDHKcveA/6TVh1MSwncoDIczUZakKBSJXMITdNug9R QdOSZOmCDdGQeIXWYbeuc8P7PmfHQyWYU0+UNeydEJ6NDURaQw/PJnOtAOwXe2tpzda/ nVNcGkrkT2N+pbz2YHLh1HoKCKd6qrvT44klMOEp9pTQOBwI3tJ4BvRJlCSQngJx6yHn xNuMOXs1a/U39oy+rhhMw0wn2Scik19iSkwcflh4+udAoXNG+Yhwi+yMCgzHiCeuEh9W 5dSvi1TVoMUP6XocsF4UR98ukodWhZ9grKRyADG9CDfrwQC+Gby2ebp2nij5kkZFJFp3 XlVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fr6/+Ggj; 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 u17sor827500ljd.86.2018.03.14.09.59.24 for (Google Transport Security); Wed, 14 Mar 2018 09:59:24 -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=fr6/+Ggj; 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=wNxOIumF5VO8wdO7axQyrg1Yf0ybJeBuC4ybXh+k+I4=; b=fr6/+GgjVMM6ONKoT5Y5XD9BgwOLrVVKk8MQov8PpSmU38EY7qJZNpYIKQTxHSlCo0 TK2k+r1XqfA3TcDYPbjfQ2bZTX8LWMoOI5uLv41vd2JVfAQxwm1FqmTvFtYqJ4QJbiwy NoyXnh7qlXFG8kkuWgg3s6RyKbc2+gzR6g/eQ= 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=dc3GXFpNMTtL3V42Vcv8t3h8QQCsBTuNuzaBA6xFVCpTOmbH1zLR+Qw4OcuI+FsyQe 5VsUpu67l9AOdCyzrWdfFLZNuoqT07HjP2DX+VPSw2LeDzAsHlL0QT6P5UZwVAAKspg/ T0qlqF1KUNlGyFSkb8NVCbPK2Vsx221Fe0MpSnLskZcty5kWO+1De40Vhg/f6B00CVhi svgdRnP3Em6AWLAA2RnU8rzQc/u1Fdfw0QdRN37haoVzal+MFj9vmDm/r9UH8UlQFaO0 If8Jd28de+v0GnScM9gb3NTW77rQMOgj9LBgp5hLnNktmxyUsow3i32P1kXEiprboYPg vugg== X-Gm-Message-State: AElRT7G2jI2OjffnAXJoiMSX0GolNJG42ppiuMdfUYvfwDhbG/21KEtC gNGPdQZ3rGdQT3RngaDk+P8YwzZR X-Google-Smtp-Source: AG47ELtzP2YX6t9eBDCncKmPtJu3beW26wv+teg9NbPjAvlfv5znXhcE5XaSWjsURBCxTLLwzXqh9Q== X-Received: by 10.46.84.86 with SMTP id y22mr3780805ljd.36.1521046764681; Wed, 14 Mar 2018 09:59:24 -0700 (PDT) Return-Path: Received: from uffe-XPS-13-9360.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id t24-v6sm724849lfi.30.2018.03.14.09.59.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 14 Mar 2018 09:59:23 -0700 (PDT) From: Ulf Hansson To: "Rafael J . Wysocki" , Sudeep Holla , Lorenzo Pieralisi , linux-pm@vger.kernel.org Cc: Kevin Hilman , Lina Iyer , Lina Iyer , Ulf Hansson , Rob Herring , Daniel Lezcano , Thomas Gleixner , Vincent Guittot , Stephen Boyd , Juri Lelli , Geert Uytterhoeven , linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v6 12/25] cpuidle: dt: Support hierarchical CPU idle states Date: Wed, 14 Mar 2018 17:58:22 +0100 Message-Id: <1521046715-30683-13-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1521046715-30683-1-git-send-email-ulf.hansson@linaro.org> References: <1521046715-30683-1-git-send-email-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(). 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(-) -- 2.7.4 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;