From patchwork Wed Sep 11 10:13:10 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 19960 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f200.google.com (mail-vc0-f200.google.com [209.85.220.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 44F01248D9 for ; Wed, 11 Sep 2013 10:17:32 +0000 (UTC) Received: by mail-vc0-f200.google.com with SMTP id hf12sf10129465vcb.11 for ; Wed, 11 Sep 2013 03:17:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:x-gm-message-state:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:in-reply-to:references :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=AzCOc/+PKVXfAhSv7XLR1eafW88/x66KIITq7NqNE3k=; b=SoHom0sXr64UncYdCRFs3UBiPF1SjDq51sfdy2Ng+tO1nDVHR/Ikl9r++ec2UCMgfO Wj2n/xNSrgS/m8gVnHQCL+KKYifTLSAV9KoyXeUvS+5y9hf5kztrxJYtdMZ7gI1p4NyU 5E3PC/XUqyC81WXQPNJweQcCOV0YV4Fg9ALXkoH47HP7WxRSdO5+vSlzrcOEZL6H15hN Gk76DVteIB/Dt/wGIBV/99/Wgh+gVyTOZzF+frCGJSX8mmXSIEDj8Ib8//jvPQIZslea jFWraey5ZZc0X/Zq8fJ7iMMEZdaMDgv2rp7e2G+E9qk3+4U5ZgwRZCuMg/YG8OKqT/jY yQ1w== X-Received: by 10.236.94.205 with SMTP id n53mr339481yhf.44.1378894652108; Wed, 11 Sep 2013 03:17:32 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.99.106 with SMTP id ep10ls171588qeb.59.gmail; Wed, 11 Sep 2013 03:17:31 -0700 (PDT) X-Received: by 10.58.119.233 with SMTP id kx9mr513019veb.3.1378894651883; Wed, 11 Sep 2013 03:17:31 -0700 (PDT) Received: from mail-ve0-f170.google.com (mail-ve0-f170.google.com [209.85.128.170]) by mx.google.com with ESMTPS id m10si105302veh.120.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 11 Sep 2013 03:17:31 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.170 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.170; Received: by mail-ve0-f170.google.com with SMTP id c14so5779865vea.1 for ; Wed, 11 Sep 2013 03:17:31 -0700 (PDT) X-Gm-Message-State: ALoCoQli+zleNZNkjzjj1txZr05qFIEttrjK0evequtuEyPau0Yc/9PypCIKE5NXY6dobpo59SIv X-Received: by 10.52.232.165 with SMTP id tp5mr429902vdc.11.1378894651661; Wed, 11 Sep 2013 03:17:31 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp47866vcz; Wed, 11 Sep 2013 03:17:31 -0700 (PDT) X-Received: by 10.68.21.66 with SMTP id t2mr784887pbe.151.1378894650854; Wed, 11 Sep 2013 03:17:30 -0700 (PDT) Received: from mail-pb0-f44.google.com (mail-pb0-f44.google.com [209.85.160.44]) by mx.google.com with ESMTPS id r5si4551400pbj.151.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 11 Sep 2013 03:17:30 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.44 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.160.44; Received: by mail-pb0-f44.google.com with SMTP id xa7so8886571pbc.17 for ; Wed, 11 Sep 2013 03:17:30 -0700 (PDT) X-Received: by 10.66.3.235 with SMTP id f11mr2264755paf.178.1378894650093; Wed, 11 Sep 2013 03:17:30 -0700 (PDT) Received: from localhost ([27.57.128.127]) by mx.google.com with ESMTPSA id bb1sm28852128pbc.10.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 11 Sep 2013 03:17:29 -0700 (PDT) From: Viresh Kumar To: rjw@sisk.pl Cc: linaro-kernel@lists.linaro.org, patches@linaro.org, cpufreq@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Viresh Kumar Subject: [PATCH 4/5] cpufreq: use cpufreq_driver->flags to mark CPUFREQ_HAVE_GOVERNOR_PER_POLICY Date: Wed, 11 Sep 2013 15:43:10 +0530 Message-Id: <69ea27eaafa485eb1bf563a2fcdbc8283000b48f.1378893296.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 1.7.12.rc2.18.g61b472e In-Reply-To: References: In-Reply-To: References: X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: viresh.kumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.170 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Lets use cpufreq_driver->flags to mark CPUFREQ_HAVE_GOVERNOR_PER_POLICY instead of a separate field within cpufreq_driver. This will save some bytes for us. Signed-off-by: Viresh Kumar --- drivers/cpufreq/arm_big_little.c | 4 ++-- drivers/cpufreq/cpufreq.c | 2 +- drivers/cpufreq/cpufreq_governor.h | 5 ++++- include/linux/cpufreq.h | 15 ++++++++------- 4 files changed, 15 insertions(+), 11 deletions(-) diff --git a/drivers/cpufreq/arm_big_little.c b/drivers/cpufreq/arm_big_little.c index 3549f07..768aa9c 100644 --- a/drivers/cpufreq/arm_big_little.c +++ b/drivers/cpufreq/arm_big_little.c @@ -214,13 +214,13 @@ static struct freq_attr *bL_cpufreq_attr[] = { static struct cpufreq_driver bL_cpufreq_driver = { .name = "arm-big-little", - .flags = CPUFREQ_STICKY, + .flags = CPUFREQ_STICKY | + CPUFREQ_HAVE_GOVERNOR_PER_POLICY, .verify = bL_cpufreq_verify_policy, .target = bL_cpufreq_set_target, .get = bL_cpufreq_get, .init = bL_cpufreq_init, .exit = bL_cpufreq_exit, - .have_governor_per_policy = true, .attr = bL_cpufreq_attr, }; diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 749bf06..3ac98a5 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -135,7 +135,7 @@ static DEFINE_MUTEX(cpufreq_governor_mutex); bool have_governor_per_policy(void) { - return cpufreq_driver->have_governor_per_policy; + return !!(cpufreq_driver->flags & CPUFREQ_HAVE_GOVERNOR_PER_POLICY); } EXPORT_SYMBOL_GPL(have_governor_per_policy); diff --git a/drivers/cpufreq/cpufreq_governor.h b/drivers/cpufreq/cpufreq_governor.h index 88cd39f..b5f2b86 100644 --- a/drivers/cpufreq/cpufreq_governor.h +++ b/drivers/cpufreq/cpufreq_governor.h @@ -191,7 +191,10 @@ struct common_dbs_data { struct attribute_group *attr_group_gov_sys; /* one governor - system */ struct attribute_group *attr_group_gov_pol; /* one governor - policy */ - /* Common data for platforms that don't set have_governor_per_policy */ + /* + * Common data for platforms that don't set + * CPUFREQ_HAVE_GOVERNOR_PER_POLICY + */ struct dbs_data *gdbs_data; struct cpu_dbs_common_info *(*get_cpu_cdbs)(int cpu); diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index c71dc0f..e0a9f15 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h @@ -180,13 +180,6 @@ __ATTR(_name, 0644, show_##_name, store_##_name) struct cpufreq_driver { char name[CPUFREQ_NAME_LEN]; u8 flags; - /* - * This should be set by platforms having multiple clock-domains, i.e. - * supporting multiple policies. With this sysfs directories of governor - * would be created in cpu/cpu/cpufreq/ directory and so they can - * use the same governor with different tunables for different clusters. - */ - bool have_governor_per_policy; /* needed by all drivers */ int (*init) (struct cpufreq_policy *policy); @@ -220,6 +213,14 @@ struct cpufreq_driver { #define CPUFREQ_PM_NO_WARN (1 << 2) /* don't warn on suspend/resume speed mismatches */ +/* + * This should be set by platforms having multiple clock-domains, i.e. + * supporting multiple policies. With this sysfs directories of governor would + * be created in cpu/cpu/cpufreq/ directory and so they can use the same + * governor with different tunables for different clusters. + */ +#define CPUFREQ_HAVE_GOVERNOR_PER_POLICY (1 << 3) + int cpufreq_register_driver(struct cpufreq_driver *driver_data); int cpufreq_unregister_driver(struct cpufreq_driver *driver_data);