From patchwork Fri Sep 13 12:59:13 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 20061 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 F118A202E6 for ; Fri, 13 Sep 2013 13:03:51 +0000 (UTC) Received: by mail-vc0-f200.google.com with SMTP id hf12sf1188836vcb.3 for ; Fri, 13 Sep 2013 06:03:51 -0700 (PDT) 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: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=n3wMOWXXOtQNxarYYZcyQII1C7o3wnJ/BBR42sktCyk=; b=f45yOpGBbRnO9GQHDnu2kmSWCFl6CgHCTktfI+XnYMWMZD/wNP2cR4PPlEn9u5NsiT Ht35FSXO43z42vl1XYPzsgOKNR1YmVYpYCBrdOl56nnSS/IkkW9Pwy+Ueo0/Bui3sV1k qtgQZOyNK3Ay2bBzTHqjm2dPO0W1uTB0R3Ex7u8j8XlqWc1QFFGtYz98WMBomMqvbGb7 8CEqeDb3tL6v/yqCN+M0MgRM6sb6xI/A5Jyq8I0tpRLyFjKWv0eG89Rrf0R81uRaQ1D8 QosnASTsDTF0+hKK9/m43nfn6gNzMJTbvgVmiWivuysWrwAsTPdRYyDi9V/CWhXFltxn 3Cgw== X-Gm-Message-State: ALoCoQnDERkPWMOUrcTMrAbJf11FtplD+XwE2cW1SUJo2sTCQkl7069HH5lwK2p2RVFUUtzqWH8X X-Received: by 10.58.238.199 with SMTP id vm7mr909008vec.17.1379077431728; Fri, 13 Sep 2013 06:03:51 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.58.148 with SMTP id r20ls1182971qeq.3.gmail; Fri, 13 Sep 2013 06:03:51 -0700 (PDT) X-Received: by 10.220.105.199 with SMTP id u7mr11657789vco.1.1379077431503; Fri, 13 Sep 2013 06:03:51 -0700 (PDT) Received: from mail-vb0-f43.google.com (mail-vb0-f43.google.com [209.85.212.43]) by mx.google.com with ESMTPS id l1si3079671vcl.139.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:03:51 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.43 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.43; Received: by mail-vb0-f43.google.com with SMTP id h11so869343vbh.2 for ; Fri, 13 Sep 2013 06:03:51 -0700 (PDT) X-Received: by 10.52.165.131 with SMTP id yy3mr5934414vdb.25.1379077431177; Fri, 13 Sep 2013 06:03:51 -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 u4csp79418vcz; Fri, 13 Sep 2013 06:03:50 -0700 (PDT) X-Received: by 10.68.189.70 with SMTP id gg6mr13353801pbc.123.1379077430261; Fri, 13 Sep 2013 06:03:50 -0700 (PDT) Received: from mail-pd0-f179.google.com (mail-pd0-f179.google.com [209.85.192.179]) by mx.google.com with ESMTPS id ql10si7406053pbb.130.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:03:50 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.192.179 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.192.179; Received: by mail-pd0-f179.google.com with SMTP id v10so1214195pde.38 for ; Fri, 13 Sep 2013 06:03:49 -0700 (PDT) X-Received: by 10.68.52.200 with SMTP id v8mr13530990pbo.48.1379077429844; Fri, 13 Sep 2013 06:03:49 -0700 (PDT) Received: from localhost ([122.167.78.148]) by mx.google.com with ESMTPSA id uw6sm11659250pbc.8.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:03:49 -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, linux-arm-kernel@lists.infradead.org, Viresh Kumar Subject: [PATCH 007/228] cpufreq: use cpufreq_driver->flags to mark CPUFREQ_HAVE_GOVERNOR_PER_POLICY Date: Fri, 13 Sep 2013 18:29:13 +0530 Message-Id: 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.212.43 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 d5fb343..c7274e6 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 0eda235..fef5f3c 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h @@ -181,13 +181,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); @@ -227,6 +220,14 @@ struct cpufreq_driver { */ #define CPUFREQ_ASYNC_NOTIFICATION (1 << 3) +/* + * 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 << 4) + int cpufreq_register_driver(struct cpufreq_driver *driver_data); int cpufreq_unregister_driver(struct cpufreq_driver *driver_data);