From patchwork Fri Sep 13 13:02:37 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 20265 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ye0-f199.google.com (mail-ye0-f199.google.com [209.85.213.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4149B20358 for ; Fri, 13 Sep 2013 13:28:11 +0000 (UTC) Received: by mail-ye0-f199.google.com with SMTP id l4sf1170298yen.6 for ; Fri, 13 Sep 2013 06:28:11 -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=cvHc13PhhwnlPrq2BWcn5JYLZmjzaeVsDvmHHhou5LY=; b=bZvujxp6bJMfgHk4Nh1LozxDr2xWvwwNq8B8/pk5G6Uc/k3QjwHNnj+6PdoD1ZWbZ/ gqgozHTvz7FgTHhD4wPu+zxpfgqy21DswrUCaFUmDMVDTrXTONQO5D0C4M5bqEZ1ft+C HkEdTKRXnlrkVBju5kOXGnxAmoRRcIVOTeKdf3slVqK/GUgNl0IKb+x0VU/Etrpjfazk oYUUnNEbLChHRfxTXxHFyyNh9fYn/5XDiYoddyJfdSJR3XFnRMgD4rfzGkNV470sJrmL aV16J0tox8iCYDWXicpIPzoVWFO8+PEpBfCHSWjBRAa7uDLBEjTlL2SlFFfq3U99dyZm OViA== X-Gm-Message-State: ALoCoQm6cbp8wuYeN3vik5fmaSWjqmKYJvF/Egq+nbwQplzJ994IlIZhjJPejIQ4b4XI6g9WW5lT X-Received: by 10.236.26.202 with SMTP id c50mr5036246yha.14.1379078891010; Fri, 13 Sep 2013 06:28:11 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.49.196 with SMTP id w4ls1120857qen.71.gmail; Fri, 13 Sep 2013 06:28:10 -0700 (PDT) X-Received: by 10.58.152.3 with SMTP id uu3mr11975591veb.16.1379078890809; Fri, 13 Sep 2013 06:28:10 -0700 (PDT) Received: from mail-vc0-f181.google.com (mail-vc0-f181.google.com [209.85.220.181]) by mx.google.com with ESMTPS id bz3si3115113vcb.123.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:28:10 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.181 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.181; Received: by mail-vc0-f181.google.com with SMTP id hz10so902655vcb.26 for ; Fri, 13 Sep 2013 06:28:10 -0700 (PDT) X-Received: by 10.221.6.195 with SMTP id ol3mr213334vcb.34.1379078890192; Fri, 13 Sep 2013 06:28:10 -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 u4csp80751vcz; Fri, 13 Sep 2013 06:28:09 -0700 (PDT) X-Received: by 10.68.33.34 with SMTP id o2mr13391127pbi.128.1379078888965; Fri, 13 Sep 2013 06:28:08 -0700 (PDT) Received: from mail-pa0-f50.google.com (mail-pa0-f50.google.com [209.85.220.50]) by mx.google.com with ESMTPS id mo9si7461370pbc.216.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:28:08 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.50 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.220.50; Received: by mail-pa0-f50.google.com with SMTP id fb10so2524701pad.37 for ; Fri, 13 Sep 2013 06:28:08 -0700 (PDT) X-Received: by 10.68.178.132 with SMTP id cy4mr13550553pbc.85.1379078888574; Fri, 13 Sep 2013 06:28:08 -0700 (PDT) Received: from localhost ([122.167.78.148]) by mx.google.com with ESMTPSA id zq10sm18131366pab.6.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:28:08 -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 , Stephen Warren Subject: [PATCH 211/228] cpufreq: tegra: remove calls to cpufreq_notify_transition() Date: Fri, 13 Sep 2013 18:32:37 +0530 Message-Id: <69073c98beae28a6a75103dd202ec2a6b8b1a674.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.220.181 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: Stephen Warren Signed-off-by: Viresh Kumar Acked-by: Stephen Warren --- drivers/cpufreq/tegra-cpufreq.c | 25 +++++-------------------- 1 file changed, 5 insertions(+), 20 deletions(-) diff --git a/drivers/cpufreq/tegra-cpufreq.c b/drivers/cpufreq/tegra-cpufreq.c index bd7d89c..f42df7e 100644 --- a/drivers/cpufreq/tegra-cpufreq.c +++ b/drivers/cpufreq/tegra-cpufreq.c @@ -102,12 +102,8 @@ static int tegra_update_cpu_speed(struct cpufreq_policy *policy, unsigned long rate) { int ret = 0; - struct cpufreq_freqs freqs; - freqs.old = tegra_getspeed(0); - freqs.new = rate; - - if (freqs.old == freqs.new) + if (tegra_getspeed(0) == rate) return ret; /* @@ -121,21 +117,10 @@ static int tegra_update_cpu_speed(struct cpufreq_policy *policy, else clk_set_rate(emc_clk, 100000000); /* emc 50Mhz */ - cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE); - -#ifdef CONFIG_CPU_FREQ_DEBUG - printk(KERN_DEBUG "cpufreq-tegra: transition: %u --> %u\n", - freqs.old, freqs.new); -#endif - - ret = tegra_cpu_clk_set_rate(freqs.new * 1000); - if (ret) { - pr_err("cpu-tegra: Failed to set cpu frequency to %d kHz\n", - freqs.new); - freqs.new = freqs.old; - } - - cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE); + ret = tegra_cpu_clk_set_rate(rate * 1000); + if (ret) + pr_err("cpu-tegra: Failed to set cpu frequency to %lu kHz\n", + rate); return ret; }