From patchwork Thu Jan 31 02:03:53 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 2070541 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 1A119DF2A1 for ; Thu, 31 Jan 2013 02:04:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753818Ab3AaCEI (ORCPT ); Wed, 30 Jan 2013 21:04:08 -0500 Received: from mail-pb0-f48.google.com ([209.85.160.48]:58904 "EHLO mail-pb0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753310Ab3AaCEG (ORCPT ); Wed, 30 Jan 2013 21:04:06 -0500 Received: by mail-pb0-f48.google.com with SMTP id wy12so1327696pbc.7 for ; Wed, 30 Jan 2013 18:04:06 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state; bh=CVKUs+8LgF6psJsv/k2PufY4jOBEwl6YNA8ydh/Mp2g=; b=gebeNm/vpI+iTQqle86KL6Zilev/wXoriWFhee4ztqoVOufQ7Kgo4B5s4PL9VFgB/+ JETThg9tY3Fe1tSVQXQR8E1COxZpOwpTcAKE93ZQkswxOQBQ7u6L4dlEKZL9qIP8oFGC mnJK2gusAXPISNcg+vx58kTZymg6sgXoHd81UrhZrFZAmm/iyHwtJqlkYu8FoSZ1r5/g fA3nUu+n+CLJXoo/+hNtz8D5IEp4fxswBXYnmv3Y67+rOrrSYz5uRJTNTU0iqi55dLS1 1Qq8yHz1Uc05aKZmmj5eV/gVw6uJJmhusu3BshaAqDr2oqp5DmQpW0ZttaFjzO0Wpn9y wfrg== X-Received: by 10.68.225.42 with SMTP id rh10mr17543118pbc.145.1359597846107; Wed, 30 Jan 2013 18:04:06 -0800 (PST) Received: from localhost ([122.172.195.129]) by mx.google.com with ESMTPS id l5sm3816523pax.10.2013.01.30.18.04.01 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 30 Jan 2013 18:04:05 -0800 (PST) From: Viresh Kumar To: rjw@sisk.pl Cc: cpufreq@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linaro-dev@lists.linaro.org, robin.randhawa@arm.com, Steve.Bannister@arm.com, Liviu.Dudau@arm.com, fabio.baltieri@linaro.org, Viresh Kumar Subject: [PATCH] cpufreq: Update Documentation for cpus and related_cpus Date: Thu, 31 Jan 2013 07:33:53 +0530 Message-Id: <5bacee23a68ff51390df30ac58c93edd244222f8.1359597694.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 1.7.12.rc2.18.g61b472e X-Gm-Message-State: ALoCoQn4PDBKLCfiJ2ccHczFuJx3MgTZF0YVAQNIYLoW4b/jtMuqkNRB3iEL+lbHxlJV+H/lk0b4 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Documentation related to cpus and related_cpus is confusing and not very clear. Over that CPUFreq core has seen much changes recently. Lets update documentation and comments for cpus and related_cpus. Signed-off-by: Viresh Kumar --- Documentation/cpu-freq/cpu-drivers.txt | 6 ++++++ Documentation/cpu-freq/user-guide.txt | 8 ++++---- include/linux/cpufreq.h | 6 ++++-- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/Documentation/cpu-freq/cpu-drivers.txt b/Documentation/cpu-freq/cpu-drivers.txt index c436096..72f70b1 100644 --- a/Documentation/cpu-freq/cpu-drivers.txt +++ b/Documentation/cpu-freq/cpu-drivers.txt @@ -111,6 +111,12 @@ policy->governor must contain the "default policy" for For setting some of these values, the frequency table helpers might be helpful. See the section 2 for more information on them. +SMP systems normally have same clock source for a group of cpus. For these the +.init() would be called only once for the first online cpu. Here the .init() +routine must initialize policy->cpus with mask of all possible cpus (Online + +Offline) that share the clock. Then the core would copy this mask onto +policy->related_cpus and will reset policy->cpus to carry only online cpus. + 1.3 verify ------------ diff --git a/Documentation/cpu-freq/user-guide.txt b/Documentation/cpu-freq/user-guide.txt index 04f6b32..ff2f283 100644 --- a/Documentation/cpu-freq/user-guide.txt +++ b/Documentation/cpu-freq/user-guide.txt @@ -190,11 +190,11 @@ scaling_max_freq show the current "policy limits" (in first set scaling_max_freq, then scaling_min_freq. -affected_cpus : List of CPUs that require software coordination - of frequency. +affected_cpus : List of Online CPUs that require software + coordination of frequency. -related_cpus : List of CPUs that need some sort of frequency - coordination, whether software or hardware. +related_cpus : List of Online + Offline CPUs that need software + coordination of frequency. scaling_driver : Hardware driver for cpufreq. diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index b60f6ba..04d2e84 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h @@ -86,8 +86,10 @@ struct cpufreq_real_policy { }; struct cpufreq_policy { - cpumask_var_t cpus; /* CPUs requiring sw coordination */ - cpumask_var_t related_cpus; /* CPUs with any coordination */ + /* CPUs sharing clock, require sw coordination */ + cpumask_var_t cpus; /* Online CPUs only */ + cpumask_var_t related_cpus; /* Online + Offline CPUs */ + unsigned int shared_type; /* ANY or ALL affected CPUs should set cpufreq */ unsigned int cpu; /* cpu nr of registered CPU */