From patchwork Mon Mar 4 07:37:56 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 2210981 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 E69ABDFF33 for ; Mon, 4 Mar 2013 07:38:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755368Ab3CDHih (ORCPT ); Mon, 4 Mar 2013 02:38:37 -0500 Received: from mail-pb0-f42.google.com ([209.85.160.42]:43126 "EHLO mail-pb0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754981Ab3CDHie (ORCPT ); Mon, 4 Mar 2013 02:38:34 -0500 Received: by mail-pb0-f42.google.com with SMTP id xb4so2926159pbc.15 for ; Sun, 03 Mar 2013 23:38:33 -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:in-reply-to :references:in-reply-to:references:x-gm-message-state; bh=S/Y0XNlwrMu9hhRRxw6KSJ6euE5qQafjz3qN01eBpZA=; b=hnj/mSg/heSINLiki6dAOmr1vkt86//0b9R7nfDd+DaRKorPL6+sM/gwHGAMQzrnqj qKF0Q+H29MfDzl/VE1yB76WwYaJ1p37n3KBSSjrD8i778yFcj3XejNUgl2qjumzNl0d7 cqdoRemeNvhWPv2zWW+HbMKbJXNxil04hzGs5K8nelrlTiyIjV/RDJ3NPCiHyfS6mTCA fdV/L0Ar5hI5Z9EEHbZYrstaS7NRUCfqv4gNx8LJqFZFqUf1huvCOPYlt0ZenJ8Ui7Qr 7rGrt43x2dtJSLff7ZVSern05W7QSLCv6znDRMr7e5T7Ulsp4bJSLwC+TNfK1uz5MZfg 2Uxg== X-Received: by 10.68.134.3 with SMTP id pg3mr27337857pbb.51.1362382713559; Sun, 03 Mar 2013 23:38:33 -0800 (PST) Received: from localhost ([118.143.64.134]) by mx.google.com with ESMTPS id zv5sm21211243pab.2.2013.03.03.23.38.30 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sun, 03 Mar 2013 23:38:32 -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-kernel@lists.linaro.org, robin.randhawa@arm.com, Steve.Bannister@arm.com, Liviu.Dudau@arm.com, charles.garcia-tobin@arm.com, Viresh Kumar Subject: [PATCH V3 4/4] cpufreq: Add Kconfig option to enable/disable have_multiple_policies Date: Mon, 4 Mar 2013 15:37:56 +0800 Message-Id: X-Mailer: git-send-email 1.7.12.rc2.18.g61b472e In-Reply-To: References: In-Reply-To: References: X-Gm-Message-State: ALoCoQk6WKD/8Or2Fd2KeNGpDCKYHzZg/p2zXFpWCW90t3BWlHP8NeD+dqgCl5izTBrDMNoKFFOv Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org have_multiple_policies is required by platforms having multiple clock-domains for cpus, i.e. supporting multiple policies for cpus. This patch adds in a Kconfig option for enabling execution of this code. Reported-by: Borislav Petkov Signed-off-by: Viresh Kumar --- drivers/cpufreq/Kconfig | 3 +++ include/linux/cpufreq.h | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/drivers/cpufreq/Kconfig b/drivers/cpufreq/Kconfig index cbcb21e..e6e6939 100644 --- a/drivers/cpufreq/Kconfig +++ b/drivers/cpufreq/Kconfig @@ -23,6 +23,9 @@ config CPU_FREQ_TABLE config CPU_FREQ_GOV_COMMON bool +config CPU_FREQ_HAVE_MULTIPLE_POLICIES + bool + config CPU_FREQ_STAT tristate "CPU frequency translation statistics" select CPU_FREQ_TABLE diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index 6e1abd2..a092fcb 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h @@ -107,11 +107,13 @@ struct cpufreq_policy { unsigned int policy; /* see above */ struct cpufreq_governor *governor; /* see below */ void *governor_data; +#ifdef CONFIG_CPU_FREQ_HAVE_MULTIPLE_POLICIES /* This should be set by init() of platforms having multiple * clock-domains, i.e. supporting multiple policies. With this sysfs * directories of governor would be created in cpu/cpu/cpufreq/ * directory */ bool have_multiple_policies; +#endif struct work_struct update; /* if update_policy() needs to be * called, but you're in IRQ context */ @@ -142,9 +144,11 @@ static inline bool policy_is_shared(struct cpufreq_policy *policy) static inline struct kobject * get_governor_parent_kobj(struct cpufreq_policy *policy) { +#ifdef CONFIG_CPU_FREQ_HAVE_MULTIPLE_POLICIES if (policy->have_multiple_policies) return &policy->kobj; else +#endif return cpufreq_global_kobject; }