From patchwork Thu Oct 29 12:27:22 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 55762 Delivered-To: patch@linaro.org Received: by 10.112.61.134 with SMTP id p6csp530189lbr; Thu, 29 Oct 2015 05:28:48 -0700 (PDT) X-Received: by 10.107.166.79 with SMTP id p76mr3113976ioe.163.1446121728819; Thu, 29 Oct 2015 05:28:48 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f129si2810940ioe.182.2015.10.29.05.28.48; Thu, 29 Oct 2015 05:28:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 S1756940AbbJ2M2r (ORCPT + 28 others); Thu, 29 Oct 2015 08:28:47 -0400 Received: from mail-pa0-f48.google.com ([209.85.220.48]:35563 "EHLO mail-pa0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756244AbbJ2M1l (ORCPT ); Thu, 29 Oct 2015 08:27:41 -0400 Received: by pasz6 with SMTP id z6so39962359pas.2 for ; Thu, 29 Oct 2015 05:27:41 -0700 (PDT) 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=aAx4vZzDbYsfS6k/LEegCKilsINuA3VXsoryXR5bNrE=; b=U4Mz11J9n0aHqNn0d1lXlpPVmBjCLED6eQNEWptH3M7XxC/NKyKhBiMQ2r/2jPNGtP ZgNrED/XOLwPuouHVi7Ls0MZ7jO54dkrgh5PdTUGa6m2+bUXLOyKnjOVdJRIhErMoZvT V/LIYC5EU13JJ//Jv9LGMNaYEKcEtd+/pr3zAQekgizoWaK7+kBSwxNuskwuTEdaMgsC XvXxSUfyDoEcwjIVjzzCdHGHnbIaPjpxRcjJ4dEm5nq5M2DZp07KycF4ugNs+8/gRnua VFs6o1/7EVRX5KRxhUiMJB/p6bUp+Y0PKcOgTkrp7Yap3A6pMZK3EQ8+KBM3hyF5QjPB sJGQ== 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=aAx4vZzDbYsfS6k/LEegCKilsINuA3VXsoryXR5bNrE=; b=aCF4j9Vpx9HuFLXc9mXRgFnITln+JzqyhXlwwTWyl5sAbtcpscApHvHhY0yKY/d5A0 aAI+P+U5A7J75KWe1+IorTonKpy0z16J7r6VZbUHsVY31/zNb/79CIh4nKKlA5X7xOoU OjvoqQgSkvTlsNPU8cD3ZRq5XnEl3B76B0SPzJBN3mvIKp1M5tw1ZqHxAFJAWI4LExQU RvOe0oB0MCzGYzKXW64vyaWBljOmqIiy1K2hM87hPsz1osALs4gkmJaJ8wi27knuYV2h TYnJuY4E3iJzn3tuES+sZxxKOZ0JsFzpGHDn71LWbZdrRvTzqq2jnDHp//6wJLQNF4X9 w8Vw== X-Gm-Message-State: ALoCoQnqWIaaORzUiPr99ljsheCgH1YaS0Kp2tSqvAgZPP7j0Tv2e779aRcU/eu0fV/Y29SOBaa5 X-Received: by 10.68.254.137 with SMTP id ai9mr1656035pbd.68.1446121661460; Thu, 29 Oct 2015 05:27:41 -0700 (PDT) Received: from localhost ([122.172.111.169]) by smtp.gmail.com with ESMTPSA id xm9sm2211283pbc.32.2015.10.29.05.27.40 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 29 Oct 2015 05:27:40 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, Viresh Kumar , linux-kernel@vger.kernel.org (open list) Subject: [PATCH 3/6] cpufreq: governor: Pass policy as argument to ->gov_dbs_timer() Date: Thu, 29 Oct 2015 17:57:22 +0530 Message-Id: <594333ba3495aed2571f032af306d891994cf31c.1446121217.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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ 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 edab71528b8b..0848c8ac6847 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);