From patchwork Thu Dec 3 04:07:51 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 57593 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp3272163lbb; Wed, 2 Dec 2015 20:08:30 -0800 (PST) X-Received: by 10.98.9.4 with SMTP id e4mr10070899pfd.18.1449115710064; Wed, 02 Dec 2015 20:08:30 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id sq8si9154944pab.10.2015.12.02.20.08.29; Wed, 02 Dec 2015 20:08:30 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dkim=neutral (body hash did not verify) header.i=@linaro-org.20150623.gappssmtp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758131AbbLCEIR (ORCPT + 11 others); Wed, 2 Dec 2015 23:08:17 -0500 Received: from mail-pa0-f49.google.com ([209.85.220.49]:34167 "EHLO mail-pa0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757441AbbLCEIM (ORCPT ); Wed, 2 Dec 2015 23:08:12 -0500 Received: by padhx2 with SMTP id hx2so59446623pad.1 for ; Wed, 02 Dec 2015 20:08:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=zAlA5bG04bKrpuSnr3CY1LRzCiqui4IbFyCr4tzTnGo=; b=A+rypqbOdqgH37K0GmrbIP/lFHb9wtoLZw319e58KMpQoSPYDv5lrt3Jdk+MUwjBDO lgxXNKxCg0ldWomdyIlU0DVvoi4Mzwg4IPC93ruru7jHEv+qjp4XmLefn6wzEpULU1iI UYuj6EE1SEtXrZlthfnOL9FA8EBBeKkUwhA+jxE72uLnSG8D3Y2b0IDG/VgOPWcJ/OMU b+vygxopqX0RLAaLGM8Mw10TFQ8TovytYN/ylsDEtsUO70m/MXaZjr4IrD7ZZxEpnEaG +/Vd8UFi6Wq5MoH9Ts36yLhFbHe+cmBBHGytAJrFlE1Iwo0rAnDUAWTM0D2HPX+ius2Z zbMg== 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=zAlA5bG04bKrpuSnr3CY1LRzCiqui4IbFyCr4tzTnGo=; b=Eqcl8P/I7RwRSU7NrGWQN/5xLzy3OrgK6XcwtsSGvE0OwmQo5OAvFn0gZTY7nEUxaC LecrlZ7Rl0isVkL85volfMEFqXOl+t4o8EV84SoR8nPVSgm+bdleB3STbI28OaqfPC1P TmrgxtXl+x+c2FFTgaIdDap8YX5/h3/AWDiP4RkDTUEBRE3lCRX2rhROGRPLGf/Cjfek WGvKdIkKVbB2nlq936dJ6eObrGQQhHIT0iSO2H9hPnXa3IWuHDtZDmMtyAWzTptkg6/I ldgi7f48+AzSi3IqjJ2+t3jYqlPGVreza6z0QIOViqaP72Zcc9ncagEuJ7BTslV6Nogx S1gg== X-Gm-Message-State: ALoCoQlKfmrFC1zV7AXptusyM3g8VfBgh51CJEvPN/eqsEj8UNoE2zDk4bo5HBr399cTH4S5BJBO X-Received: by 10.66.236.162 with SMTP id uv2mr10053222pac.101.1449115691679; Wed, 02 Dec 2015 20:08:11 -0800 (PST) Received: from localhost ([122.172.170.156]) by smtp.gmail.com with ESMTPSA id yn8sm7227725pac.32.2015.12.02.20.08.10 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Wed, 02 Dec 2015 20:08:11 -0800 (PST) From: Viresh Kumar To: Rafael Wysocki Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, ashwin.chaugule@linaro.org, Viresh Kumar , linux-kernel@vger.kernel.org (open list) Subject: [PATCH V2 3/6] cpufreq: governor: Pass policy as argument to ->gov_dbs_timer() Date: Thu, 3 Dec 2015 09:37:51 +0530 Message-Id: <58060974dfb6759c9fda2ed3c1649ff7d75df5ad.1449115453.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.6.2.198.g614a2ac In-Reply-To: References: In-Reply-To: References: Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Pass 'policy' as argument to ->gov_dbs_timer() instead of cdbs and dbs_data. Signed-off-by: Viresh Kumar --- drivers/cpufreq/cpufreq_conservative.c | 6 +++--- drivers/cpufreq/cpufreq_governor.c | 2 +- drivers/cpufreq/cpufreq_governor.h | 3 +-- drivers/cpufreq/cpufreq_ondemand.c | 5 ++--- 4 files changed, 7 insertions(+), 9 deletions(-) -- 2.6.2.198.g614a2ac -- To unsubscribe from this list: send the line "unsubscribe linux-pm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/cpufreq/cpufreq_conservative.c b/drivers/cpufreq/cpufreq_conservative.c index 1fa1deb6e91f..606ad74abe6e 100644 --- a/drivers/cpufreq/cpufreq_conservative.c +++ b/drivers/cpufreq/cpufreq_conservative.c @@ -115,13 +115,13 @@ static void cs_check_cpu(int cpu, unsigned int load) } } -static unsigned int cs_dbs_timer(struct cpu_dbs_info *cdbs, - struct dbs_data *dbs_data, bool modify_all) +static unsigned int cs_dbs_timer(struct cpufreq_policy *policy, bool modify_all) { + struct dbs_data *dbs_data = policy->governor_data; struct cs_dbs_tuners *cs_tuners = dbs_data->tuners; if (modify_all) - dbs_check_cpu(dbs_data, cdbs->shared->policy->cpu); + dbs_check_cpu(dbs_data, policy->cpu); return delay_for_sampling_rate(cs_tuners->sampling_rate); } diff --git a/drivers/cpufreq/cpufreq_governor.c b/drivers/cpufreq/cpufreq_governor.c index b260576ddb12..cdcb56a49b28 100644 --- a/drivers/cpufreq/cpufreq_governor.c +++ b/drivers/cpufreq/cpufreq_governor.c @@ -253,7 +253,7 @@ static void dbs_timer(struct work_struct *work) if (!need_load_eval(cdbs->shared, sampling_rate)) modify_all = false; - delay = dbs_data->cdata->gov_dbs_timer(cdbs, dbs_data, modify_all); + delay = dbs_data->cdata->gov_dbs_timer(policy, modify_all); gov_queue_work(dbs_data, policy, delay, modify_all); unlock: diff --git a/drivers/cpufreq/cpufreq_governor.h b/drivers/cpufreq/cpufreq_governor.h index 5621bb03e874..0c7589016b6c 100644 --- a/drivers/cpufreq/cpufreq_governor.h +++ b/drivers/cpufreq/cpufreq_governor.h @@ -209,8 +209,7 @@ struct common_dbs_data { struct cpu_dbs_info *(*get_cpu_cdbs)(int cpu); void *(*get_cpu_dbs_info_s)(int cpu); - unsigned int (*gov_dbs_timer)(struct cpu_dbs_info *cdbs, - struct dbs_data *dbs_data, + unsigned int (*gov_dbs_timer)(struct cpufreq_policy *policy, bool modify_all); void (*gov_check_cpu)(int cpu, unsigned int load); int (*init)(struct dbs_data *dbs_data, bool notify); diff --git a/drivers/cpufreq/cpufreq_ondemand.c b/drivers/cpufreq/cpufreq_ondemand.c index 08f2aa602f9e..fc0384b4d02d 100644 --- a/drivers/cpufreq/cpufreq_ondemand.c +++ b/drivers/cpufreq/cpufreq_ondemand.c @@ -191,10 +191,9 @@ static void od_check_cpu(int cpu, unsigned int load) } } -static unsigned int od_dbs_timer(struct cpu_dbs_info *cdbs, - struct dbs_data *dbs_data, bool modify_all) +static unsigned int od_dbs_timer(struct cpufreq_policy *policy, bool modify_all) { - struct cpufreq_policy *policy = cdbs->shared->policy; + struct dbs_data *dbs_data = policy->governor_data; unsigned int cpu = policy->cpu; struct od_cpu_dbs_info_s *dbs_info = &per_cpu(od_cpu_dbs_info, cpu);