From patchwork Thu Apr 21 08:58:54 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 66355 Delivered-To: patch@linaro.org Received: by 10.140.93.198 with SMTP id d64csp18536qge; Thu, 21 Apr 2016 02:02:50 -0700 (PDT) X-Received: by 10.98.86.77 with SMTP id k74mr18672265pfb.28.1461229370728; Thu, 21 Apr 2016 02:02:50 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y64si2501652pfy.25.2016.04.21.02.02.50; Thu, 21 Apr 2016 02:02:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752173AbcDUJCs (ORCPT + 29 others); Thu, 21 Apr 2016 05:02:48 -0400 Received: from mail-pf0-f182.google.com ([209.85.192.182]:34492 "EHLO mail-pf0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752020AbcDUI7Y (ORCPT ); Thu, 21 Apr 2016 04:59:24 -0400 Received: by mail-pf0-f182.google.com with SMTP id y69so11199200pfb.1 for ; Thu, 21 Apr 2016 01:59:24 -0700 (PDT) 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 :in-reply-to:references; bh=Qtz5Bq3R0dZVpP1Fs/Ll+5iCdhlTpjxQi68+jfn6FYg=; b=QaNiLCSYgGNBRfK3rAN0E5FUWrJVy0xq+7ptuU+h0yQSu5D0m0sV4/DeIE3mSU2XZK sOZKRLeEUaYut4Un2FpNUE3jiq6ptpo04lm9a626BGx02wRopoP4xe5AmGg3+Dnh0GPw ci7+o4YUeF7/qoUodLljCugfhwhzhOPNXQxqc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=Qtz5Bq3R0dZVpP1Fs/Ll+5iCdhlTpjxQi68+jfn6FYg=; b=CaPKtVpL4dK/kM20n6X6wMvQOP0yoYIa+UnJj2qkYxYEwjd1ggJ5lthSc8j4hc9/ya tMpo33fyrjvea/QK6iVkSZp9qgIS46o2DIQlc7pZWaUY+17Zb+2KN85ORfNmaEBoKb6U 9fPewIMHtSFKgtJoSIpjSj/gg+cStWBQDAkO+dqWKpOOafgeD3jT4CSPrlSQhGms1d2W 8rBiplDx7s1RT7uKDqY+0e57KCH7dEALKgIvw/iAVAT48Yq6vdUeFXB0lR6qBPzFXlwc twe/TunV7NgR5rMYdlShFG01mgPZR14Ie06rLUQ/mEpUxQO704OPFnU6PKY/o0V+OFwf PVfw== X-Gm-Message-State: AOPr4FWA9Dl8IeV6s9rJN0r7nq4t3RI2D9AuhNfqjmx7Wq95kVZOGEKpcABUEn4LEDNCIlJ7 X-Received: by 10.98.69.132 with SMTP id n4mr4945986pfi.53.1461229163976; Thu, 21 Apr 2016 01:59:23 -0700 (PDT) Received: from localhost ([122.167.26.250]) by smtp.gmail.com with ESMTPSA id w189sm3086814pfw.46.2016.04.21.01.59.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Apr 2016 01:59:23 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki , Viresh Kumar , Nishanth Menon , Stephen Boyd Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, arnd.bergmann@linaro.org, andrew@lunn.ch, gregory.clement@free-electrons.com, jason@lakedaemon.net, sebastian.hesselbarth@gmail.com, thomas.petazzoni@free-electrons.com, Viresh Kumar , linux-kernel@vger.kernel.org Subject: [PATCH 02/10] PM / OPP: Add missing doc style comments Date: Thu, 21 Apr 2016 14:28:54 +0530 Message-Id: <084f8a8dbb2b0c97d2e1343d1f14d165b9942e02.1461228504.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.7.1.410.g6faf27b In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Few of the routines in cpu.c were missing these, add them. Signed-off-by: Viresh Kumar --- drivers/base/power/opp/cpu.c | 59 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 58 insertions(+), 1 deletion(-) -- 2.7.1.410.g6faf27b diff --git a/drivers/base/power/opp/cpu.c b/drivers/base/power/opp/cpu.c index b7411a3cdcb1..b151401d1513 100644 --- a/drivers/base/power/opp/cpu.c +++ b/drivers/base/power/opp/cpu.c @@ -119,7 +119,22 @@ void dev_pm_opp_free_cpufreq_table(struct device *dev, EXPORT_SYMBOL_GPL(dev_pm_opp_free_cpufreq_table); #endif /* CONFIG_CPU_FREQ */ -/* Required only for V1 bindings, as v2 can manage it from DT itself */ +/** + * dev_pm_opp_set_sharing_cpus() - Mark OPP table as shared by few CPUs + * @cpu_dev: CPU device for which we do this operation + * @cpumask: cpumask of the CPUs which share the OPP table with @cpu_dev + * + * This marks OPP table of the @cpu_dev as shared by the CPUs present in + * @cpumask. + * + * Returns -ENODEV if OPP table isn't already present. + * + * Locking: The internal opp_table and opp structures are RCU protected. + * Hence this function internally uses RCU updater strategy with mutex locks + * to keep the integrity of the internal data structures. Callers should ensure + * that this function is *NOT* called under RCU protection or in contexts where + * mutex cannot be locked. + */ int dev_pm_opp_set_sharing_cpus(struct device *cpu_dev, cpumask_var_t cpumask) { struct opp_device *opp_dev; @@ -161,6 +176,18 @@ int dev_pm_opp_set_sharing_cpus(struct device *cpu_dev, cpumask_var_t cpumask) EXPORT_SYMBOL_GPL(dev_pm_opp_set_sharing_cpus); #ifdef CONFIG_OF +/** + * dev_pm_opp_of_cpumask_remove_table() - Removes OPP table for @cpumask + * @cpumask: cpumask for which OPP table needs to be removed + * + * This removes the OPP tables for CPUs present in the @cpumask. + * + * Locking: The internal opp_table and opp structures are RCU protected. + * Hence this function internally uses RCU updater strategy with mutex locks + * to keep the integrity of the internal data structures. Callers should ensure + * that this function is *NOT* called under RCU protection or in contexts where + * mutex cannot be locked. + */ void dev_pm_opp_of_cpumask_remove_table(cpumask_var_t cpumask) { struct device *cpu_dev; @@ -181,6 +208,18 @@ void dev_pm_opp_of_cpumask_remove_table(cpumask_var_t cpumask) } EXPORT_SYMBOL_GPL(dev_pm_opp_of_cpumask_remove_table); +/** + * dev_pm_opp_of_cpumask_add_table() - Adds OPP table for @cpumask + * @cpumask: cpumask for which OPP table needs to be added. + * + * This adds the OPP tables for CPUs present in the @cpumask. + * + * Locking: The internal opp_table and opp structures are RCU protected. + * Hence this function internally uses RCU updater strategy with mutex locks + * to keep the integrity of the internal data structures. Callers should ensure + * that this function is *NOT* called under RCU protection or in contexts where + * mutex cannot be locked. + */ int dev_pm_opp_of_cpumask_add_table(cpumask_var_t cpumask) { struct device *cpu_dev; @@ -216,6 +255,24 @@ EXPORT_SYMBOL_GPL(dev_pm_opp_of_cpumask_add_table); * * Returns -ENOENT if operating-points-v2 bindings aren't supported. */ +/** + * dev_pm_opp_of_get_sharing_cpus() - Get cpumask of CPUs sharing OPPs with + * @cpu_dev using operating-points-v2 + * bindings. + * + * @cpu_dev: CPU device for which we do this operation + * @cpumask: cpumask to update with information of sharing CPUs + * + * This updates the @cpumask with CPUs that are sharing OPPs with @cpu_dev. + * + * Returns -ENOENT if operating-points-v2 isn't present for @cpu_dev. + * + * Locking: The internal opp_table and opp structures are RCU protected. + * Hence this function internally uses RCU updater strategy with mutex locks + * to keep the integrity of the internal data structures. Callers should ensure + * that this function is *NOT* called under RCU protection or in contexts where + * mutex cannot be locked. + */ int dev_pm_opp_of_get_sharing_cpus(struct device *cpu_dev, cpumask_var_t cpumask) { struct device_node *np, *tmp_np;