From patchwork Wed Oct 3 14:38:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 148061 Delivered-To: patches@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp6557616lji; Wed, 3 Oct 2018 07:38:50 -0700 (PDT) X-Received: by 2002:a2e:50e:: with SMTP id 14-v6mr1400250ljf.152.1538577530312; Wed, 03 Oct 2018 07:38:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538577530; cv=none; d=google.com; s=arc-20160816; b=RRxv4aWCQIF7huyHUFyKLilSOccJPOFIm33pVKROgxMnCUHtQiWiPF0PYFN9Aor+yh e0xKkl4f/Pdf89tE7+BXs2nVU09QJB8mDSCd1O+Geso3VIOeNkCYISm4A0RYF1MA6npi AkKYBDix6uzDe8oqW1o8Rfq1cQrQLUXyN344qX4ciGqootWMdPYcVaZmj5iuTz6jMcIn PFqUYt789TVuJvDwwCgun0AIvkS5v2zHFWSFlHFT3TWzCLQJhKzPz6IwIowSmdkol+Ab jZzQTzSzNhRG/DGCzW0EyrS1Y9awk8385TFJnlRLtt+2UOjX3H7MjeY9643vsjIZwLh5 T5CQ== 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=NdOVQOgn6QPfKNtGaQ+NXVIYYOcD0EuuWacQGnuhPH8=; b=AivuxaeHKXPC9xdIl/AHztMZgtL9bVrrDA32XbjvfgjNgw7tuDQcmvy1baKSj0t1yS gKPIclfNBOHT6QlBTLx2deVE6ySlQWa47ViGKJg59mH4FU3jh60Y4d+Oba7B3OH2eZIU o207TgLhY/ltV2AYF89C9IDoWGdkmK1opk9p7gXPLBMfAAMHUAd0eyz+o8dPFjeA6jUb /Iej7IMxyprOunMfp+qKwrUSEAPoIep+7zz1YU0Ril/15/y+D11JdjqzOjZOnUB46mhv HWRqakK+eCgFY6IRjjHhqew3qOzFgNbv/Xo9zNAAYaXVZzcdbB83tgdQ7CDHR+NtqDhq avWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WRWo6nk0; 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 z7-v6sor973140ljk.22.2018.10.03.07.38.50 for (Google Transport Security); Wed, 03 Oct 2018 07:38:50 -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=WRWo6nk0; 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=NdOVQOgn6QPfKNtGaQ+NXVIYYOcD0EuuWacQGnuhPH8=; b=WRWo6nk0nJa1hY05q+tQgr8xYnf2RAMUdfJAU1VKIlIychduM+cr+0DxYEisUldbgH +/Rt0QJ+NphPgxHDcGKI/myX65HaEuMqK3zWKyh4M0a9UZFtPkE7T53oOXkcZ4QqMCk6 1+HW35LznBwGCIspaeGz+RXntF71adUgghmqI= 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=NdOVQOgn6QPfKNtGaQ+NXVIYYOcD0EuuWacQGnuhPH8=; b=joNbUxdIE7sPXmTjILqsWQIJLqQNY3pYFVJQaDM24PrQ8031R9UCV+qNBsKtUFIa69 BQPUthpOAdnbfXyW03Jv4+iq7xMRAe5r9KCapoROLcbQX6vGBX1KBcHf23lui9pa9+oE BiX5nYyF9V2Y4W31mK4scd9uSKpi9a87bf/y0OsR5X7/gbx7uTp5KOonNHmOj7tFS8Nv Hybx5HHzXyxRGLzjMn7TRtAmRnNZzOsbo2P8LAsIS5owWczRiDkEjwwkcLIeUhl8QNjJ C65cluNnBYTWdQcW2TqGoa6mzODmCJBohJifc43NjYuyiilV3oBAdfuswc15wGyogomE lrtA== X-Gm-Message-State: ABuFfogfOnhrlEMUG9QhlcDQrJeN9P994334s0sUXL5muSpZm9JUPhOW M6g+TT8xotxNoKaVIdzGT7VRzR6m X-Google-Smtp-Source: ACcGV63AVZN1e1UHiciRJACevTU85s4dyI3oLi6l675UID00+PW7/sACBRYiDcjYfxt4IYXNSs8MVQ== X-Received: by 2002:a2e:591d:: with SMTP id n29-v6mr1383472ljb.70.1538577530142; Wed, 03 Oct 2018 07:38:50 -0700 (PDT) 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 18-v6sm380867ljo.74.2018.10.03.07.38.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 Oct 2018 07:38:49 -0700 (PDT) From: Ulf Hansson To: "Rafael J . Wysocki" , Sudeep Holla , Lorenzo Pieralisi , Mark Rutland , Daniel Lezcano , linux-pm@vger.kernel.org Cc: Tony Lindgren , Kevin Hilman , Lina Iyer , Ulf Hansson , Rob Herring , Viresh Kumar , Vincent Guittot , Geert Uytterhoeven , linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Lina Iyer Subject: [PATCH v9 06/11] cpuidle: dt: Support hierarchical CPU idle states Date: Wed, 3 Oct 2018 16:38:19 +0200 Message-Id: <20181003143824.13059-7-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181003143824.13059-1-ulf.hansson@linaro.org> References: <20181003143824.13059-1-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.17.1 diff --git a/drivers/cpuidle/dt_idle_states.c b/drivers/cpuidle/dt_idle_states.c index 53342b7f1010..13f9b7cd32d1 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;