From patchwork Fri Sep 13 13:02:14 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 20242 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qe0-f72.google.com (mail-qe0-f72.google.com [209.85.128.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 28E3E20358 for ; Fri, 13 Sep 2013 13:25:25 +0000 (UTC) Received: by mail-qe0-f72.google.com with SMTP id 6sf1235483qea.3 for ; Fri, 13 Sep 2013 06:25:25 -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=XoraLpRUbDFi8JoY2FCFhmB8fIeKAplReJS2ee868fs=; b=Y0V4gtFdLdA/IQ5eXikMf1iDDN1JSmtcK6olCPIlZYVaUmJesx1WwjEC2watb+Ud5N h+FWzneIBg9ErHocBVifGHAaH5t6uf8tv31ScTB70TpmyIN18oOyAOg4xK/qzMlBFZjA yYfkgDODAoTZ6RKR2pc231FQ2t92EtjZ24oR3IB8YCatB04oUqinqgxg/JpsDTZ6Ohky 1bC2gwRHBwblQs9bS3YxgZOMs5O+rqCMpGO4xOFcPRow9rhJG6UFVNsqcWIHZO4VcLEE Uf0DY++II5+ReilmKGreLQq6ybdWGwOrDoOye/YHfcbVu8Ur7eOn1B51PYYKveMWBRVs T6Yg== X-Gm-Message-State: ALoCoQlFfV6io9Y9fFvDfCz6V/nDPiHf3ZUm/pH7E9acHvSisYe9+1hYAYIQxlYDpqrUpuxFHWPX X-Received: by 10.236.19.225 with SMTP id n61mr4970515yhn.8.1379078724950; Fri, 13 Sep 2013 06:25:24 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.117.129 with SMTP id ke1ls1150568qeb.88.gmail; Fri, 13 Sep 2013 06:25:24 -0700 (PDT) X-Received: by 10.58.161.116 with SMTP id xr20mr11997102veb.2.1379078724734; Fri, 13 Sep 2013 06:25:24 -0700 (PDT) Received: from mail-ve0-f175.google.com (mail-ve0-f175.google.com [209.85.128.175]) by mx.google.com with ESMTPS id ci9si3132064vcb.31.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:25:24 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.175 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.175; Received: by mail-ve0-f175.google.com with SMTP id jy13so946212veb.34 for ; Fri, 13 Sep 2013 06:25:24 -0700 (PDT) X-Received: by 10.221.32.133 with SMTP id sk5mr1136156vcb.27.1379078724644; Fri, 13 Sep 2013 06:25:24 -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 u4csp80611vcz; Fri, 13 Sep 2013 06:25:24 -0700 (PDT) X-Received: by 10.68.136.7 with SMTP id pw7mr13361708pbb.106.1379078723775; Fri, 13 Sep 2013 06:25:23 -0700 (PDT) Received: from mail-pa0-f54.google.com (mail-pa0-f54.google.com [209.85.220.54]) by mx.google.com with ESMTPS id gb4si7478703pbb.120.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:25:23 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.54 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.220.54; Received: by mail-pa0-f54.google.com with SMTP id kx10so2544527pab.27 for ; Fri, 13 Sep 2013 06:25:23 -0700 (PDT) X-Received: by 10.66.11.202 with SMTP id s10mr15558225pab.86.1379078723348; Fri, 13 Sep 2013 06:25:23 -0700 (PDT) Received: from localhost ([122.167.78.148]) by mx.google.com with ESMTPSA id yh1sm7155128pbc.21.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:25:22 -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 , Sekhar Nori Subject: [PATCH 188/228] cpufreq: davinci: remove calls to cpufreq_notify_transition() Date: Fri, 13 Sep 2013 18:32:14 +0530 Message-Id: <9a944db26cd8764758e93c67f81fa50a224688c5.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.175 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: Sekhar Nori Signed-off-by: Viresh Kumar --- drivers/cpufreq/davinci-cpufreq.c | 30 ++++++++++-------------------- 1 file changed, 10 insertions(+), 20 deletions(-) diff --git a/drivers/cpufreq/davinci-cpufreq.c b/drivers/cpufreq/davinci-cpufreq.c index 1f5d8a5..5e8a854 100644 --- a/drivers/cpufreq/davinci-cpufreq.c +++ b/drivers/cpufreq/davinci-cpufreq.c @@ -68,46 +68,36 @@ static unsigned int davinci_getspeed(unsigned int cpu) static int davinci_target(struct cpufreq_policy *policy, unsigned int idx) { - int ret = 0; - struct cpufreq_freqs freqs; struct davinci_cpufreq_config *pdata = cpufreq.dev->platform_data; struct clk *armclk = cpufreq.armclk; + unsigned int old_freq, new_freq; + int ret = 0; - freqs.old = davinci_getspeed(0); - freqs.new = pdata->freq_table[idx].frequency; - - dev_dbg(cpufreq.dev, "transition: %u --> %u\n", freqs.old, freqs.new); - - cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE); + old_freq = davinci_getspeed(0); + new_freq = pdata->freq_table[idx].frequency; /* if moving to higher frequency, up the voltage beforehand */ - if (pdata->set_voltage && freqs.new > freqs.old) { + if (pdata->set_voltage && new_freq > old_freq) { ret = pdata->set_voltage(idx); if (ret) - goto out; + return ret; } ret = clk_set_rate(armclk, idx); if (ret) - goto out; + return ret; if (cpufreq.asyncclk) { ret = clk_set_rate(cpufreq.asyncclk, cpufreq.asyncrate); if (ret) - goto out; + return ret; } /* if moving to lower freq, lower the voltage after lowering freq */ - if (pdata->set_voltage && freqs.new < freqs.old) + if (pdata->set_voltage && new_freq < old_freq) pdata->set_voltage(idx); -out: - if (ret) - freqs.new = freqs.old; - - cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE); - - return ret; + return 0; } static int davinci_cpu_init(struct cpufreq_policy *policy)