From patchwork Thu Oct 16 13:59:56 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Pieralisi X-Patchwork-Id: 38820 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f200.google.com (mail-lb0-f200.google.com [209.85.217.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id DFAB220973 for ; Thu, 16 Oct 2014 13:59:31 +0000 (UTC) Received: by mail-lb0-f200.google.com with SMTP id b6sf1945820lbj.3 for ; Thu, 16 Oct 2014 06:59:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe:content-type :content-transfer-encoding; bh=/3OERwcdE5UssOZhqub4WNsqX+dkRNy3MubS0RlhMHk=; b=cRV/+LEKe8rU3llbmuNmSM0h/osKC7N33/yLkJOwMmJUg1nAxc3Z4fdXba2Mh/98MN DGVNnxKTGJGJ2ZU1lnY7C6WCBf4iM19qGfvC7XXYm28EKf3Cmho4H8lM+MNfmDZqhG10 sGjZkuyzgSTpSv6hjYbYEPr+TPqKTAij0pMkIaWzJsQHaADjp+J27D/FJjOUv+pTwQV6 8EFCs35XaZ/US+grZpI4a8wpJ08PmR0zgAjNbNnBIZcjt7P0TExM3lMfqfEyI6qCgipw e+pJ5L5UqQIrsUMCuJvUtp/SG7Dp036BoPz32fCcdrmIpPfrvr1Via+mk8wrKSVN79VC DddA== X-Gm-Message-State: ALoCoQnO5VlXb0NwOpH3Ki5pHWFh2TLdAfzCWWzdVwwg1miXNXhJGyTjTcRk+vJpowXVmqEKUOTs X-Received: by 10.152.3.168 with SMTP id d8mr318525lad.0.1413467970701; Thu, 16 Oct 2014 06:59:30 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.18.202 with SMTP id y10ls164512lad.51.gmail; Thu, 16 Oct 2014 06:59:30 -0700 (PDT) X-Received: by 10.152.179.164 with SMTP id dh4mr1774091lac.55.1413467970483; Thu, 16 Oct 2014 06:59:30 -0700 (PDT) Received: from mail-la0-f45.google.com (mail-la0-f45.google.com [209.85.215.45]) by mx.google.com with ESMTPS id yg7si34805738lbb.133.2014.10.16.06.59.30 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 16 Oct 2014 06:59:30 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.45 as permitted sender) client-ip=209.85.215.45; Received: by mail-la0-f45.google.com with SMTP id q1so2938171lam.18 for ; Thu, 16 Oct 2014 06:59:30 -0700 (PDT) X-Received: by 10.112.221.197 with SMTP id qg5mr1917266lbc.32.1413467970383; Thu, 16 Oct 2014 06:59:30 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.84.229 with SMTP id c5csp43975lbz; Thu, 16 Oct 2014 06:59:29 -0700 (PDT) X-Received: by 10.70.132.133 with SMTP id ou5mr1508810pdb.51.1413467968604; Thu, 16 Oct 2014 06:59:28 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id fd3si12381915pad.74.2014.10.16.06.59.27 for ; Thu, 16 Oct 2014 06:59:28 -0700 (PDT) Received-SPF: none (google.com: linux-pm-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752595AbaJPN70 (ORCPT + 15 others); Thu, 16 Oct 2014 09:59:26 -0400 Received: from service87.mimecast.com ([91.220.42.44]:40428 "EHLO service87.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752487AbaJPN7Z (ORCPT ); Thu, 16 Oct 2014 09:59:25 -0400 Received: from cam-owa2.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.21]) by service87.mimecast.com; Thu, 16 Oct 2014 14:59:23 +0100 Received: from red-moon.cambridge.arm.com ([10.1.255.212]) by cam-owa2.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 16 Oct 2014 14:59:19 +0100 From: Lorenzo Pieralisi To: linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org Cc: devicetree@vger.kernel.org, Lorenzo Pieralisi , Kevin Hilman , Mark Rutland , Rob Herring , Daniel Lezcano , Chander Kashyap , Stephen Boyd Subject: [PATCH 2/3] drivers: cpuidle: add idle-state-name description to ARM idle states Date: Thu, 16 Oct 2014 14:59:56 +0100 Message-Id: <1413467997-32131-2-git-send-email-lorenzo.pieralisi@arm.com> X-Mailer: git-send-email 2.1.2 In-Reply-To: <1413467997-32131-1-git-send-email-lorenzo.pieralisi@arm.com> References: <1413467997-32131-1-git-send-email-lorenzo.pieralisi@arm.com> X-OriginalArrivalTime: 16 Oct 2014 13:59:19.0492 (UTC) FILETIME=[61836840:01CFE949] X-MC-Unique: 114101614592317701 Sender: linux-pm-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: lorenzo.pieralisi@arm.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.45 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , On ARM machines, where generally speaking the idle state numbering has no fixed and standard meaning it is useful to provide a description of the idle state inner workings for benchmarking and monitoring purposes. This patch adds a property to the idle states bindings that if present gives platform firmware a means of describing the idle state and export the string description to user space. The patch updates the DT parsing code accordingly to take the description, if present, into consideration. Cc: Kevin Hilman Signed-off-by: Lorenzo Pieralisi --- Documentation/devicetree/bindings/arm/idle-states.txt | 6 ++++++ drivers/cpuidle/dt_idle_states.c | 7 ++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/arm/idle-states.txt b/Documentation/devicetree/bindings/arm/idle-states.txt index d8ab4b9..6f68718 100644 --- a/Documentation/devicetree/bindings/arm/idle-states.txt +++ b/Documentation/devicetree/bindings/arm/idle-states.txt @@ -331,6 +331,12 @@ follows: If property is not present the idle-state must be considered operational. + - idle-state-name: + Usage: Optional + Value type: + Definition: A string used as a descriptive name for the idle + state. + In addition to the properties listed above, a state node may require additional properties specifics to the entry-method defined in the idle-states node, please refer to the entry-method bindings diff --git a/drivers/cpuidle/dt_idle_states.c b/drivers/cpuidle/dt_idle_states.c index 22840f4..5301912 100644 --- a/drivers/cpuidle/dt_idle_states.c +++ b/drivers/cpuidle/dt_idle_states.c @@ -27,6 +27,7 @@ static int init_state_node(struct cpuidle_state *idle_state, { int err; const struct of_device_id *match_id; + const char *desc; match_id = of_match_node(matches, state_node); if (!match_id) @@ -73,6 +74,10 @@ static int init_state_node(struct cpuidle_state *idle_state, return -EINVAL; } + err = of_property_read_string(state_node, "idle-state-name", &desc); + if (err) + desc = state_node->name; + idle_state->flags = CPUIDLE_FLAG_TIME_VALID; if (of_property_read_bool(state_node, "local-timer-stop")) idle_state->flags |= CPUIDLE_FLAG_TIMER_STOP; @@ -82,7 +87,7 @@ static int init_state_node(struct cpuidle_state *idle_state, * and desc become string pointers */ strncpy(idle_state->name, state_node->name, CPUIDLE_NAME_LEN - 1); - strncpy(idle_state->desc, state_node->name, CPUIDLE_DESC_LEN - 1); + strncpy(idle_state->desc, desc, CPUIDLE_DESC_LEN - 1); return 0; }