From patchwork Fri Aug 16 02:25:00 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 2845374 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 903159F239 for ; Fri, 16 Aug 2013 02:27:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B77EC202EA for ; Fri, 16 Aug 2013 02:27:55 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BA2C2202C6 for ; Fri, 16 Aug 2013 02:27:54 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VA9kt-0002kk-TZ; Fri, 16 Aug 2013 02:27:12 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VA9ke-0006Vj-Ko; Fri, 16 Aug 2013 02:26:56 +0000 Received: from mail-pb0-f44.google.com ([209.85.160.44]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VA9kJ-0006QD-76 for linux-arm-kernel@lists.infradead.org; Fri, 16 Aug 2013 02:26:36 +0000 Received: by mail-pb0-f44.google.com with SMTP id xa7so1465409pbc.31 for ; Thu, 15 Aug 2013 19:26:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=e9cfOudqpvFTyoYqt05shIBpdu1/1gycdxgqYM9qxik=; b=OpHawaXJICQNHRViOoPquc6y8a/6aAva9JNM1XM+peeP49CtwA5fEBKrr46T+Ca5YB bvzE7fdz7H5ZmO0u0d62CfS3Wz4wvu0/J49q5XUy9AJiaBvkAgCJdOubkkY25ZVBdWOn LMoWivv0HvEaPAYEkcKZ+FCQ/cV1kYUnE7cvza7DzKOAQC3maKmUo2uemBSyAaJGHaun Z3xUnsXngffmlkurF5K+ZqTAAPWOda3ba2xJBddjdW4xG2fOSAHPJvuobwMrX/Y7n1X0 47I18U8s0Mt8rB8i06pyM6XT25nn5rhX0v49RmZoWk25XALhsubIXoR9h5iVYoo3bpHT YdvA== X-Gm-Message-State: ALoCoQmQ3/uKSFW2ytZyuzu/ICthDpFZC7wePJIN7UJraZlhwjpWMeVDHcQJuqCJ7nD0mzRZ6oE5 X-Received: by 10.68.237.3 with SMTP id uy3mr11123164pbc.155.1376619973480; Thu, 15 Aug 2013 19:26:13 -0700 (PDT) Received: from localhost ([122.172.193.46]) by mx.google.com with ESMTPSA id xl3sm2681256pbb.17.2013.08.15.19.26.09 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 15 Aug 2013 19:26:12 -0700 (PDT) From: Viresh Kumar To: rjw@sisk.pl Subject: [PATCH 03/34] cpufreq: arm_big_little: remove calls to cpufreq_notify_transition() Date: Fri, 16 Aug 2013 07:55:00 +0530 Message-Id: X-Mailer: git-send-email 1.7.12.rc2.18.g61b472e In-Reply-To: References: In-Reply-To: References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130815_222635_433819_80768512 X-CRM114-Status: GOOD ( 10.96 ) X-Spam-Score: -2.6 (--) Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, Viresh Kumar , patches@linaro.org, linux-kernel@vger.kernel.org, cpufreq@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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. Signed-off-by: Viresh Kumar --- drivers/cpufreq/arm_big_little.c | 25 +++---------------------- 1 file changed, 3 insertions(+), 22 deletions(-) diff --git a/drivers/cpufreq/arm_big_little.c b/drivers/cpufreq/arm_big_little.c index daf4423..e3e8f25 100644 --- a/drivers/cpufreq/arm_big_little.c +++ b/drivers/cpufreq/arm_big_little.c @@ -51,30 +51,11 @@ static unsigned int bL_cpufreq_get(unsigned int cpu) static int bL_cpufreq_set_target(struct cpufreq_policy *policy, unsigned int index) { - struct cpufreq_freqs freqs; - u32 cpu = policy->cpu, cur_cluster; - int ret = 0; + u32 cur_cluster; cur_cluster = cpu_to_cluster(policy->cpu); - - freqs.old = bL_cpufreq_get(policy->cpu); - freqs.new = freq_table[cur_cluster][index].frequency; - - pr_debug("%s: cpu: %d, cluster: %d, oldfreq: %d, target freq: %d, new freq: %d\n", - __func__, cpu, cur_cluster, freqs.old, freqs.new, - freqs.new); - - cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE); - - ret = clk_set_rate(clk[cur_cluster], freqs.new * 1000); - if (ret) { - pr_err("clk_set_rate failed: %d\n", ret); - freqs.new = freqs.old; - } - - cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE); - - return ret; + return clk_set_rate(clk[cur_cluster], + freq_table[cur_cluster][index].frequency * 1000); } static void put_cluster_clk_and_freq_table(struct device *cpu_dev)