From patchwork Fri Sep 13 13:02:34 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 20262 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vb0-f71.google.com (mail-vb0-f71.google.com [209.85.212.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 92C1A20358 for ; Fri, 13 Sep 2013 13:27:49 +0000 (UTC) Received: by mail-vb0-f71.google.com with SMTP id g17sf1206210vbg.6 for ; Fri, 13 Sep 2013 06:27:49 -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=p7vkItEKfQADv2cnTSpulMo8aHXlubersgAx0essk9s=; b=fNd3IX68DXutlUP8+Nsx1kx4Suy4JxTU+6ow+VV6oGpho6mjfpMheRBzc8AdPgX3Mt t8A31rZJ1JOYxsU6JndtoWuY5EpXgUEoU5f4VgcJMfxYScZ2t7b2KKJfWcCJjwBrp1Jb xDDk7KM5w/9PJSmNK19geYGyLnFZ6ydBlCvBeBldlroIRpnmJ8WCxBcoHUPal/3L3a2O EJTA8dj5ybsiPVBSkzKVKw8sLKQJ8GieLOukmfweDH95Ns9Hm8ndOcrp3N5E5/UzsZTb ItW22rvtNh/gIIF39lTrmZam9U+/R0GFpL0FCTVq/7tQqI+s6gNHIq2jTDf0wF/cZU6w DzYg== X-Gm-Message-State: ALoCoQkfkhI7cPFRDxH/I+Mhm4qC+Gf6dwFL4S49xelohmbitNT+qPrpHspqW+WaQxwUckNyBJ3x X-Received: by 10.236.56.70 with SMTP id l46mr5366679yhc.2.1379078869291; Fri, 13 Sep 2013 06:27:49 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.39.163 with SMTP id q3ls1117731qek.31.gmail; Fri, 13 Sep 2013 06:27:49 -0700 (PDT) X-Received: by 10.52.23.113 with SMTP id l17mr10244368vdf.23.1379078869031; Fri, 13 Sep 2013 06:27:49 -0700 (PDT) Received: from mail-vb0-f51.google.com (mail-vb0-f51.google.com [209.85.212.51]) by mx.google.com with ESMTPS id aj7si3138720vec.21.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:27:49 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.51 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.51; Received: by mail-vb0-f51.google.com with SMTP id x16so890933vbf.38 for ; Fri, 13 Sep 2013 06:27:49 -0700 (PDT) X-Received: by 10.52.122.68 with SMTP id lq4mr10157258vdb.21.1379078868949; Fri, 13 Sep 2013 06:27:48 -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 u4csp80737vcz; Fri, 13 Sep 2013 06:27:48 -0700 (PDT) X-Received: by 10.66.26.77 with SMTP id j13mr2112698pag.166.1379078867774; Fri, 13 Sep 2013 06:27:47 -0700 (PDT) Received: from mail-pb0-f51.google.com (mail-pb0-f51.google.com [209.85.160.51]) by mx.google.com with ESMTPS id gb4si7474973pbb.150.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:27:47 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.51 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.160.51; Received: by mail-pb0-f51.google.com with SMTP id jt11so1226077pbb.38 for ; Fri, 13 Sep 2013 06:27:47 -0700 (PDT) X-Received: by 10.66.102.40 with SMTP id fl8mr2153660pab.167.1379078867343; Fri, 13 Sep 2013 06:27:47 -0700 (PDT) Received: from localhost ([122.167.78.148]) by mx.google.com with ESMTPSA id j9sm18096140paj.18.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:27:46 -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 , "David S. Miller" , sparclinux@vger.kernel.org Subject: [PATCH 208/228] cpufreq: sparc: remove calls to cpufreq_notify_transition() Date: Fri, 13 Sep 2013 18:32:34 +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.51 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: , Most of the drivers do following in their ->target_index() routines: struct cpufreq_freqs freqs; freqs.old = old freq... freqs.new = new freq... cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE); /* Change rate here */ cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE); This is replicated over all cpufreq drivers today and there doesn't exists a good enough reason why this shouldn't be moved to cpufreq core instead. Earlier patches have added support in cpufreq core to do cpufreq notification on frequency change, this one removes it from this driver. Some related minor cleanups are also done along with it. Cc: David S. Miller Cc: sparclinux@vger.kernel.org Signed-off-by: Viresh Kumar --- drivers/cpufreq/sparc-us2e-cpufreq.c | 7 ------- drivers/cpufreq/sparc-us3-cpufreq.c | 7 ------- 2 files changed, 14 deletions(-) diff --git a/drivers/cpufreq/sparc-us2e-cpufreq.c b/drivers/cpufreq/sparc-us2e-cpufreq.c index 3bf5b8f..62aa23e 100644 --- a/drivers/cpufreq/sparc-us2e-cpufreq.c +++ b/drivers/cpufreq/sparc-us2e-cpufreq.c @@ -251,7 +251,6 @@ static int us2e_freq_target(struct cpufreq_policy *policy, unsigned int index) unsigned long new_bits, new_freq; unsigned long clock_tick, divisor, old_divisor, estar; cpumask_t cpus_allowed; - struct cpufreq_freqs freqs; cpumask_copy(&cpus_allowed, tsk_cpus_allowed(current)); set_cpus_allowed_ptr(current, cpumask_of(cpu)); @@ -265,16 +264,10 @@ static int us2e_freq_target(struct cpufreq_policy *policy, unsigned int index) old_divisor = estar_to_divisor(estar); - freqs.old = clock_tick / old_divisor; - freqs.new = new_freq; - cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE); - if (old_divisor != divisor) us2e_transition(estar, new_bits, clock_tick * 1000, old_divisor, divisor); - cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE); - set_cpus_allowed_ptr(current, &cpus_allowed); return 0; diff --git a/drivers/cpufreq/sparc-us3-cpufreq.c b/drivers/cpufreq/sparc-us3-cpufreq.c index 2e54d55..724ffbd 100644 --- a/drivers/cpufreq/sparc-us3-cpufreq.c +++ b/drivers/cpufreq/sparc-us3-cpufreq.c @@ -98,7 +98,6 @@ static int us3_freq_target(struct cpufreq_policy *policy, unsigned int index) unsigned int cpu = policy->cpu; unsigned long new_bits, new_freq, reg; cpumask_t cpus_allowed; - struct cpufreq_freqs freqs; cpumask_copy(&cpus_allowed, tsk_cpus_allowed(current)); set_cpus_allowed_ptr(current, cpumask_of(cpu)); @@ -124,16 +123,10 @@ static int us3_freq_target(struct cpufreq_policy *policy, unsigned int index) reg = read_safari_cfg(); - freqs.old = get_current_freq(cpu, reg); - freqs.new = new_freq; - cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE); - reg &= ~SAFARI_CFG_DIV_MASK; reg |= new_bits; write_safari_cfg(reg); - cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE); - set_cpus_allowed_ptr(current, &cpus_allowed); return 0;