From patchwork Thu Jun 11 10:51:55 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 49749 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f69.google.com (mail-la0-f69.google.com [209.85.215.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A37FB20C81 for ; Thu, 11 Jun 2015 10:53:11 +0000 (UTC) Received: by laboh3 with SMTP id oh3sf1136143lab.0 for ; Thu, 11 Jun 2015 03:53:10 -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 :sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=VoMFolqyiZ8gC+Rjr4H2JOukM3AsVUTsLuh5y/8DPxg=; b=FB29sdTaMQIIM5I4eV+y7yuGmbovHElp3lNvLBb/xwZHoVRVN1xIf16BIFco0aWCGW NQTJkfvdD8273i7xbVc5xZ/HO2HbooqRGFDqJ207JHMTQ87Zb0djIwvdlsHhuxuwk4Gs PKTOBgvJKIUmr89tCUkjd+LAqMEsExah9MjaB1tZARrGHLJzAoAwDOsiByvn1DRIz8kO 5Ool+K/x/o3R/BJY9FCDZb9ngjESRrxNLeLicTdQmyoQGjzSnAswcsBzThlm2mIKvcUh V1ZZP8rUhWgjt32fuTeM2xsqUcZBtSt0UEOTa4nIrq5KXPV7AFoDoOWpIYEb0WvTEYZP 2Vlw== X-Gm-Message-State: ALoCoQmt2sX1V4NJkhUfVPX9ZBeQn+eVMdWozO1t3ULD2HX/fH9t68Rt+eLM8VS/+2pP6oVRCmUG X-Received: by 10.152.9.3 with SMTP id v3mr7900563laa.6.1434019990754; Thu, 11 Jun 2015 03:53:10 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.23.74 with SMTP id k10ls386281laf.30.gmail; Thu, 11 Jun 2015 03:53:10 -0700 (PDT) X-Received: by 10.112.105.104 with SMTP id gl8mr9254160lbb.81.1434019990604; Thu, 11 Jun 2015 03:53:10 -0700 (PDT) Received: from mail-lb0-f176.google.com (mail-lb0-f176.google.com. [209.85.217.176]) by mx.google.com with ESMTPS id ei5si246594lbb.128.2015.06.11.03.53.10 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 Jun 2015 03:53:10 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.176 as permitted sender) client-ip=209.85.217.176; Received: by lbcue7 with SMTP id ue7so2231293lbc.0 for ; Thu, 11 Jun 2015 03:53:10 -0700 (PDT) X-Received: by 10.152.44.166 with SMTP id f6mr9217878lam.86.1434019990504; Thu, 11 Jun 2015 03:53:10 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp3952725lbb; Thu, 11 Jun 2015 03:53:09 -0700 (PDT) X-Received: by 10.66.218.193 with SMTP id pi1mr13659059pac.152.1434019982496; Thu, 11 Jun 2015 03:53:02 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id xz3si375664pab.181.2015.06.11.03.53.01; Thu, 11 Jun 2015 03:53:02 -0700 (PDT) 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; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752680AbbFKKxA (ORCPT + 11 others); Thu, 11 Jun 2015 06:53:00 -0400 Received: from mail-pa0-f50.google.com ([209.85.220.50]:34659 "EHLO mail-pa0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752288AbbFKKxA (ORCPT ); Thu, 11 Jun 2015 06:53:00 -0400 Received: by payr10 with SMTP id r10so2311943pay.1 for ; Thu, 11 Jun 2015 03:52:59 -0700 (PDT) X-Received: by 10.68.68.230 with SMTP id z6mr13729621pbt.102.1434019979686; Thu, 11 Jun 2015 03:52:59 -0700 (PDT) Received: from localhost ([122.167.219.251]) by mx.google.com with ESMTPSA id fk10sm397114pab.18.2015.06.11.03.52.58 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 11 Jun 2015 03:52:59 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki , Preeti U Murthy , ke.wang@spreadtrum.com Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, ego@linux.vnet.ibm.com, paulus@samba.org, shilpa.bhat@linux.vnet.ibm.com, prarit@redhat.com, robert.schoene@tu-dresden.de, skannan@codeaurora.org, Viresh Kumar Subject: [PATCH 12/12] cpufreq: conservative: remove 'enable' field Date: Thu, 11 Jun 2015 16:21:55 +0530 Message-Id: <3af78d993ca7cea8c0b1dec4c7e4714ef21e09ce.1434019473.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.4.0 In-Reply-To: References: In-Reply-To: References: Sender: linux-pm-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: viresh.kumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.176 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Conservative governor has its own 'enable' field to check in notifier if notification is required or not. The same functionality can now be achieved with 'ccdbs->enabled instead'. Lets get rid of 'enable'. Signed-off-by: Viresh Kumar --- drivers/cpufreq/cpufreq_conservative.c | 12 ++++++------ drivers/cpufreq/cpufreq_governor.c | 13 +------------ drivers/cpufreq/cpufreq_governor.h | 1 - 3 files changed, 7 insertions(+), 19 deletions(-) diff --git a/drivers/cpufreq/cpufreq_conservative.c b/drivers/cpufreq/cpufreq_conservative.c index 0e4154e584bf..e0b49729307d 100644 --- a/drivers/cpufreq/cpufreq_conservative.c +++ b/drivers/cpufreq/cpufreq_conservative.c @@ -21,6 +21,7 @@ #define DEF_SAMPLING_DOWN_FACTOR (1) #define MAX_SAMPLING_DOWN_FACTOR (10) +static struct common_dbs_data cs_dbs_cdata; static DEFINE_PER_CPU(struct cs_cpu_dbs_info_s, cs_cpu_dbs_info); static inline unsigned int get_freq_target(struct cs_dbs_tuners *cs_tuners, @@ -119,13 +120,13 @@ static int dbs_cpufreq_notifier(struct notifier_block *nb, unsigned long val, struct cpufreq_freqs *freq = data; struct cs_cpu_dbs_info_s *dbs_info = &per_cpu(cs_cpu_dbs_info, freq->cpu); - struct cpufreq_policy *policy; + struct cpu_common_dbs_info *ccdbs = dbs_info->cdbs.ccdbs; + struct cpufreq_policy *policy = ccdbs->policy; - if (!dbs_info->enable) + mutex_lock(&cs_dbs_cdata.mutex); + if (!ccdbs->enabled) return 0; - policy = dbs_info->cdbs.ccdbs->policy; - /* * we only care if our internally tracked freq moves outside the 'valid' * ranges of frequency available to us otherwise we do not change it @@ -133,6 +134,7 @@ static int dbs_cpufreq_notifier(struct notifier_block *nb, unsigned long val, if (dbs_info->requested_freq > policy->max || dbs_info->requested_freq < policy->min) dbs_info->requested_freq = freq->new; + mutex_unlock(&cs_dbs_cdata.mutex); return 0; } @@ -142,8 +144,6 @@ static struct notifier_block cs_cpufreq_notifier_block = { }; /************************** sysfs interface ************************/ -static struct common_dbs_data cs_dbs_cdata; - static ssize_t store_sampling_down_factor(struct dbs_data *dbs_data, const char *buf, size_t count) { diff --git a/drivers/cpufreq/cpufreq_governor.c b/drivers/cpufreq/cpufreq_governor.c index c26f535d3d91..7f348c3a4782 100644 --- a/drivers/cpufreq/cpufreq_governor.c +++ b/drivers/cpufreq/cpufreq_governor.c @@ -465,7 +465,6 @@ static int cpufreq_governor_start(struct cpufreq_policy *policy, cdata->get_cpu_dbs_info_s(cpu); cs_dbs_info->down_skip = 0; - cs_dbs_info->enable = 1; cs_dbs_info->requested_freq = policy->cur; } else { struct od_ops *od_ops = cdata->gov_ops; @@ -485,9 +484,7 @@ static int cpufreq_governor_start(struct cpufreq_policy *policy, static int cpufreq_governor_stop(struct cpufreq_policy *policy, struct dbs_data *dbs_data) { - struct common_dbs_data *cdata = dbs_data->cdata; - unsigned int cpu = policy->cpu; - struct cpu_dbs_info *cdbs = cdata->get_cpu_cdbs(cpu); + struct cpu_dbs_info *cdbs = dbs_data->cdata->get_cpu_cdbs(policy->cpu); struct cpu_common_dbs_info *ccdbs = cdbs->ccdbs; /* Shouldn't be already stopped */ @@ -496,14 +493,6 @@ static int cpufreq_governor_stop(struct cpufreq_policy *policy, ccdbs->enabled = false; gov_cancel_work(dbs_data, policy); - - if (cdata->governor == GOV_CONSERVATIVE) { - struct cs_cpu_dbs_info_s *cs_dbs_info = - cdata->get_cpu_dbs_info_s(cpu); - - cs_dbs_info->enable = 0; - } - return 0; } diff --git a/drivers/cpufreq/cpufreq_governor.h b/drivers/cpufreq/cpufreq_governor.h index 7da5aedb8174..7f651bdf43ae 100644 --- a/drivers/cpufreq/cpufreq_governor.h +++ b/drivers/cpufreq/cpufreq_governor.h @@ -165,7 +165,6 @@ struct cs_cpu_dbs_info_s { struct cpu_dbs_info cdbs; unsigned int down_skip; unsigned int requested_freq; - unsigned int enable:1; }; /* Per policy Governors sysfs tunables */