From patchwork Fri Sep 13 13:02:11 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 20239 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qe0-f69.google.com (mail-qe0-f69.google.com [209.85.128.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A644A20358 for ; Fri, 13 Sep 2013 13:25:03 +0000 (UTC) Received: by mail-qe0-f69.google.com with SMTP id 1sf1229607qec.4 for ; Fri, 13 Sep 2013 06:25:03 -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=erYgBE8MdpyI5gkfBIdDfc7bc9D+ddx8BX7GhN21Lis=; b=PVH1tRfT3oFV/gnLIIxf4TvDXhlu/S95Q9wEJV5ZzTQgIrGuLONsvnBJPKgF6cW2Es jRWsfHyBPcH7ZvEG/J9XUWMSVUYKPhDtx1Fs7KBzcqw2KB5AGhbi2PKyXtDaiowWJpx8 9fZXJWmIjMsXn27WrEoVT5jOOSBHhSTKhmzBq0C9fLKEYxuv6/0qtvA0Pp2SMMN/6Fyl I0Tk+DEFxIIfH1TY7haoFzByB9J2q3dquEpeC0dQNOiN7ZXXdywkiUjgceolo3phxGDZ i6gZIrR911htEAiBR59DS09ye7wlJqqEwigrVf/gVzdcaRVYk67IKDQaUR0mvUORRp+w Hcgw== X-Gm-Message-State: ALoCoQnEy0uzhFttfsFAFAWuZuwTPcAIaAuT+IRaCArVDOfDRMjylvC0m4HNm3wtYc4VYKHTae5V X-Received: by 10.236.34.134 with SMTP id s6mr671140yha.49.1379078703475; Fri, 13 Sep 2013 06:25:03 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.48.41 with SMTP id i9ls1106603qen.44.gmail; Fri, 13 Sep 2013 06:25:03 -0700 (PDT) X-Received: by 10.52.170.136 with SMTP id am8mr956364vdc.33.1379078703266; Fri, 13 Sep 2013 06:25:03 -0700 (PDT) Received: from mail-ve0-f176.google.com (mail-ve0-f176.google.com [209.85.128.176]) by mx.google.com with ESMTPS id se9si3098784vdc.140.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:25:03 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.176 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.176; Received: by mail-ve0-f176.google.com with SMTP id jx11so941627veb.7 for ; Fri, 13 Sep 2013 06:25:03 -0700 (PDT) X-Received: by 10.58.100.234 with SMTP id fb10mr12151051veb.5.1379078703186; Fri, 13 Sep 2013 06:25:03 -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 u4csp80591vcz; Fri, 13 Sep 2013 06:25:02 -0700 (PDT) X-Received: by 10.68.134.133 with SMTP id pk5mr13456629pbb.89.1379078702213; Fri, 13 Sep 2013 06:25:02 -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 ia4si7429097pbb.342.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:25:02 -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 v10so1237774pde.38 for ; Fri, 13 Sep 2013 06:25:01 -0700 (PDT) X-Received: by 10.66.161.229 with SMTP id xv5mr15492693pab.87.1379078701812; Fri, 13 Sep 2013 06:25:01 -0700 (PDT) Received: from localhost ([122.167.78.148]) by mx.google.com with ESMTPSA id om2sm11748286pbc.30.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:25:01 -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 , Steven Miao Subject: [PATCH 185/228] cpufreq: blackfin: remove calls to cpufreq_notify_transition() Date: Fri, 13 Sep 2013 18:32:11 +0530 Message-Id: <3e6166073c8fe16f07440600ae70ec24f6cd27e1.1379063063.git.viresh.kumar@linaro.org> 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.128.176 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: Steven Miao Signed-off-by: Viresh Kumar --- drivers/cpufreq/blackfin-cpufreq.c | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/drivers/cpufreq/blackfin-cpufreq.c b/drivers/cpufreq/blackfin-cpufreq.c index 12528b2..e9e63fc 100644 --- a/drivers/cpufreq/blackfin-cpufreq.c +++ b/drivers/cpufreq/blackfin-cpufreq.c @@ -132,27 +132,23 @@ static int bfin_target(struct cpufreq_policy *policy, unsigned int index) #ifndef CONFIG_BF60x unsigned int plldiv; #endif - struct cpufreq_freqs freqs; static unsigned long lpj_ref; static unsigned int lpj_ref_freq; + unsigned int old_freq, new_freq; int ret = 0; #if defined(CONFIG_CYCLES_CLOCKSOURCE) cycles_t cycles; #endif - freqs.old = bfin_getfreq_khz(0); - freqs.new = bfin_freq_table[index].frequency; + old_freq = bfin_getfreq_khz(0); + new_freq = bfin_freq_table[index].frequency; - pr_debug("cpufreq: changing cclk to %lu; target = %u, oldfreq = %u\n", - freqs.new, freqs.new, freqs.old); - - cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE); #ifndef CONFIG_BF60x plldiv = (bfin_read_PLL_DIV() & SSEL) | dpm_state_table[index].csel; bfin_write_PLL_DIV(plldiv); #else - ret = cpu_set_cclk(policy->cpu, freqs.new * 1000); + ret = cpu_set_cclk(policy->cpu, new_freq * 1000); if (ret != 0) { WARN_ONCE(ret, "cpufreq set freq failed %d\n", ret); return ret; @@ -168,17 +164,13 @@ static int bfin_target(struct cpufreq_policy *policy, unsigned int index) #endif if (!lpj_ref_freq) { lpj_ref = loops_per_jiffy; - lpj_ref_freq = freqs.old; + lpj_ref_freq = old_freq; } - if (freqs.new != freqs.old) { + if (new_freq != old_freq) { loops_per_jiffy = cpufreq_scale(lpj_ref, - lpj_ref_freq, freqs.new); + lpj_ref_freq, new_freq); } - /* TODO: just test case for cycles clock source, remove later */ - cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE); - - pr_debug("cpufreq: done\n"); return ret; }