From patchwork Wed Nov 19 10:17:57 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 41118 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f197.google.com (mail-lb0-f197.google.com [209.85.217.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id B3D4220CBB for ; Wed, 19 Nov 2014 10:18:16 +0000 (UTC) Received: by mail-lb0-f197.google.com with SMTP id b6sf192616lbj.4 for ; Wed, 19 Nov 2014 02:18:15 -0800 (PST) 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; bh=UyXfWHqytJIJ+kXXxtsLWCYnMzwNIIrFjnYpD1bnmGQ=; b=Qkor0nmMXA6mucY1qU3u0C/Wzz4QaPKgl84l8RFkQOrOTDdaNkb8GbcmhRAPT+XAOi FoHnBt0/t8HoFMhCpPB6UAT3AnpL/GazFCcWIbvPtkWNMJiW52S5coKBFba5nE1GnZ79 tINjLj2n89q39tYTKqwVg71rnJzjVu4cV0B50mrpyaeijqNUGrbar6BbFrjF/9pLz+EX 1F5YMvhWgWqXlRC/9ONrahaG9Qd87wU4nDrpT28ujCEv3CkkfIhPaQe4OtI4RNoCth4a TMgwrAaNydfLUlb5GCYBXwGil/dd4b1tBMy7gdHnFg7VMOVbWv6vIZ1ePHy+kHic5F8y ZsWw== X-Gm-Message-State: ALoCoQm7nw5S/Jx1pCc33R2kUGGtHDFMhD9TOdpt8494lbLg4f3sVPhhEisIlR5JcB9SL8rV6yl/ X-Received: by 10.112.166.102 with SMTP id zf6mr274242lbb.12.1416392295690; Wed, 19 Nov 2014 02:18:15 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.30.5 with SMTP id o5ls315080lah.84.gmail; Wed, 19 Nov 2014 02:18:15 -0800 (PST) X-Received: by 10.112.16.39 with SMTP id c7mr40798071lbd.19.1416392295303; Wed, 19 Nov 2014 02:18:15 -0800 (PST) Received: from mail-lb0-f170.google.com (mail-lb0-f170.google.com. [209.85.217.170]) by mx.google.com with ESMTPS id u2si1301125lal.70.2014.11.19.02.18.15 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 19 Nov 2014 02:18:15 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.170 as permitted sender) client-ip=209.85.217.170; Received: by mail-lb0-f170.google.com with SMTP id w7so218532lbi.29 for ; Wed, 19 Nov 2014 02:18:15 -0800 (PST) X-Received: by 10.112.235.196 with SMTP id uo4mr4415854lbc.66.1416392295179; Wed, 19 Nov 2014 02:18:15 -0800 (PST) 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.184.201 with SMTP id ew9csp57558lbc; Wed, 19 Nov 2014 02:18:14 -0800 (PST) X-Received: by 10.70.136.38 with SMTP id px6mr10111807pdb.155.1416392293518; Wed, 19 Nov 2014 02:18:13 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ya2si2021715pbb.87.2014.11.19.02.18.11 for ; Wed, 19 Nov 2014 02:18:13 -0800 (PST) Received-SPF: none (google.com: linux-kernel-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 S1755902AbaKSKSJ (ORCPT + 26 others); Wed, 19 Nov 2014 05:18:09 -0500 Received: from mail-wi0-f182.google.com ([209.85.212.182]:60487 "EHLO mail-wi0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755847AbaKSKSD (ORCPT ); Wed, 19 Nov 2014 05:18:03 -0500 Received: by mail-wi0-f182.google.com with SMTP id h11so1263920wiw.15 for ; Wed, 19 Nov 2014 02:18:02 -0800 (PST) X-Received: by 10.194.9.1 with SMTP id v1mr12240772wja.124.1416392282133; Wed, 19 Nov 2014 02:18:02 -0800 (PST) Received: from localhost.localdomain (AToulouse-656-1-820-36.w109-215.abo.wanadoo.fr. [109.215.21.36]) by mx.google.com with ESMTPSA id ll2sm1643831wjb.11.2014.11.19.02.18.00 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 19 Nov 2014 02:18:01 -0800 (PST) From: Daniel Lezcano To: rjw@rjwysocki.net Cc: Lorenzo.Pieralisi@arm.com, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 2/3] drivers: cpuidle: Add idle-state-name description to ARM idle states Date: Wed, 19 Nov 2014 11:17:57 +0100 Message-Id: <1416392278-18397-2-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1416392278-18397-1-git-send-email-daniel.lezcano@linaro.org> References: <546C6DEB.8060204@linaro.org> <1416392278-18397-1-git-send-email-daniel.lezcano@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: daniel.lezcano@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.170 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: , From: Lorenzo Pieralisi 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. Acked-by: Kevin Hilman Signed-off-by: Lorenzo Pieralisi Signed-off-by: Daniel Lezcano --- 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 5e51511..a8274ea 100644 --- a/Documentation/devicetree/bindings/arm/idle-states.txt +++ b/Documentation/devicetree/bindings/arm/idle-states.txt @@ -331,6 +331,12 @@ follows: If the 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; }