From patchwork Fri Aug 16 02:25:02 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 19178 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f199.google.com (mail-qc0-f199.google.com [209.85.216.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id B116F2486D for ; Fri, 16 Aug 2013 02:26:29 +0000 (UTC) Received: by mail-qc0-f199.google.com with SMTP id j10sf462447qcx.10 for ; Thu, 15 Aug 2013 19:26:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-gm-message-state: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=JjjQzGV52GrZUe7/JNfpATkB2uIdKrztfXyqFqEemz0nyIWlnDwGVhG/+k/PNXSUEB i4FtS2B9ozVQzXlefPyhOYZDzbyJz6JAgwqBW9v8Qc1vOGxZN9m/fY/iKAWUrpoIHayP NvAplj2jBfBo5SMyXL8IwtAoo75OyMNAnmzJ+WwkzXYCfNlJT13Ktx+H9PKLvxYVtR1j taJFFluSPziMII+P9RRWTg3e2mnP0Rg+Z43GOeVdSqLh2/V9Xz9t3nV1XwvGHHtjh6Li HixH6GUY+jhZrYy7jgiI548gJxuaO1k8nzhYMsaXrhI16MPlqTqunSCXZ+OXEHdSqDMh B6fw== X-Received: by 10.236.80.42 with SMTP id j30mr354311yhe.29.1376619989330; Thu, 15 Aug 2013 19:26:29 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.97.197 with SMTP id ec5ls606199qeb.26.gmail; Thu, 15 Aug 2013 19:26:29 -0700 (PDT) X-Received: by 10.220.91.16 with SMTP id k16mr17510447vcm.21.1376619989199; Thu, 15 Aug 2013 19:26:29 -0700 (PDT) Received: from mail-vc0-f173.google.com (mail-vc0-f173.google.com [209.85.220.173]) by mx.google.com with ESMTPS id jf10si641881vdb.154.2013.08.15.19.26.29 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 15 Aug 2013 19:26:29 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.173 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.173; Received: by mail-vc0-f173.google.com with SMTP id id13so1060211vcb.4 for ; Thu, 15 Aug 2013 19:26:29 -0700 (PDT) X-Gm-Message-State: ALoCoQnqA9HkUuKVwZQOQkcZmuiyr8Njvtf2yhpI04S4cbIoH31kfQ8OKhiMh4AUevv6wG27VGMP X-Received: by 10.52.227.6 with SMTP id rw6mr14651600vdc.19.1376619989076; Thu, 15 Aug 2013 19:26:29 -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 u4csp45142vcz; Thu, 15 Aug 2013 19:26:28 -0700 (PDT) X-Received: by 10.68.232.225 with SMTP id tr1mr11712432pbc.143.1376619988235; Thu, 15 Aug 2013 19:26:28 -0700 (PDT) Received: from mail-pa0-f41.google.com (mail-pa0-f41.google.com [209.85.220.41]) by mx.google.com with ESMTPS id xx2si38244pac.198.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 15 Aug 2013 19:26:28 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.41 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.220.41; Received: by mail-pa0-f41.google.com with SMTP id bj1so1347753pad.28 for ; Thu, 15 Aug 2013 19:26:27 -0700 (PDT) X-Received: by 10.66.246.106 with SMTP id xv10mr603369pac.100.1376619987873; Thu, 15 Aug 2013 19:26:27 -0700 (PDT) Received: from localhost ([122.172.193.46]) by mx.google.com with ESMTPSA id 7sm77896paf.22.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 15 Aug 2013 19:26:27 -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 05/34] cpufreq: blackfin: remove calls to cpufreq_notify_transition() Date: Fri, 16 Aug 2013 07:55:02 +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.220.173 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; }