From patchwork Fri Aug 16 02:25:07 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 19183 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qe0-f71.google.com (mail-qe0-f71.google.com [209.85.128.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id B5F712486D for ; Fri, 16 Aug 2013 02:27:06 +0000 (UTC) Received: by mail-qe0-f71.google.com with SMTP id 9sf1694132qea.2 for ; Thu, 15 Aug 2013 19:27:06 -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=VxWPT3cCKi5VGCbQvAeoN8odrFXZA1tJViC7s+CxFbs=; b=oofw4kiPOS/iHXdr8LXPu7tBO0MBvm3VQxMJhtbTm0OEnfwgy5JihD6aCpr0d6NhSd ea1ZsU+9XqmSsPtp6ygXSDyr91iYgXEkAR/Zdn2xYSosY2fcaTsMaItNAmzTISnHoSLP ME0EbHLw95RIs81UOk7BHAYVXJ4Cbczt76mRCI9mRiM+KxRrB7jTiQEP2GAA7GEPstIa /khf6X2N3522CDRckd63vIrbwF6uUmTAUW6zhwNNp6nXYK5tjDMKlJb4YZUy3ie+CL4T gU+g9r9JHtswBI8VFgX+dC6fKChP/kwHWEKhVWefEtpoh/ILxR0dFRA40iktqNRNrcuE IwqQ== X-Received: by 10.224.13.136 with SMTP id c8mr721486qaa.0.1376620026216; Thu, 15 Aug 2013 19:27:06 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.71.168 with SMTP id w8ls615616qeu.64.gmail; Thu, 15 Aug 2013 19:27:06 -0700 (PDT) X-Received: by 10.52.35.98 with SMTP id g2mr14748865vdj.0.1376620026056; Thu, 15 Aug 2013 19:27:06 -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 sy7si762735vdc.40.2013.08.15.19.27.06 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 15 Aug 2013 19:27:06 -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 id13so1065050vcb.18 for ; Thu, 15 Aug 2013 19:27:06 -0700 (PDT) X-Gm-Message-State: ALoCoQkuAW5XiSuV5Zx6fae/aTJfsUSW1UlmF4GOPRJ8HMbeM0gdDAzMY/63jES/rMmreMs3D5M4 X-Received: by 10.220.198.133 with SMTP id eo5mr3460681vcb.24.1376620025968; Thu, 15 Aug 2013 19:27:05 -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 u4csp45168vcz; Thu, 15 Aug 2013 19:27:05 -0700 (PDT) X-Received: by 10.68.58.97 with SMTP id p1mr12039766pbq.144.1376620025221; Thu, 15 Aug 2013 19:27:05 -0700 (PDT) Received: from mail-pa0-f44.google.com (mail-pa0-f44.google.com [209.85.220.44]) by mx.google.com with ESMTPS id os4si19892pac.294.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 15 Aug 2013 19:27:05 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.44 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.220.44; Received: by mail-pa0-f44.google.com with SMTP id fz6so1346673pac.3 for ; Thu, 15 Aug 2013 19:27:04 -0700 (PDT) X-Received: by 10.68.14.234 with SMTP id s10mr18702296pbc.139.1376620024825; Thu, 15 Aug 2013 19:27:04 -0700 (PDT) Received: from localhost ([122.172.193.46]) by mx.google.com with ESMTPSA id ia5sm2687417pbc.42.2013.08.15.19.27.01 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 15 Aug 2013 19:27:04 -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 Subject: [PATCH 10/34] cpufreq: e_powersaver: remove calls to cpufreq_notify_transition() Date: Fri, 16 Aug 2013 07:55:07 +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. Signed-off-by: Viresh Kumar --- drivers/cpufreq/e_powersaver.c | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/drivers/cpufreq/e_powersaver.c b/drivers/cpufreq/e_powersaver.c index b39c4ef..9012b8b 100644 --- a/drivers/cpufreq/e_powersaver.c +++ b/drivers/cpufreq/e_powersaver.c @@ -107,15 +107,9 @@ static int eps_set_state(struct eps_cpu_data *centaur, struct cpufreq_policy *policy, u32 dest_state) { - struct cpufreq_freqs freqs; u32 lo, hi; - int err = 0; int i; - freqs.old = eps_get(policy->cpu); - freqs.new = centaur->fsb * ((dest_state >> 8) & 0xff); - cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE); - /* Wait while CPU is busy */ rdmsr(MSR_IA32_PERF_STATUS, lo, hi); i = 0; @@ -124,8 +118,7 @@ static int eps_set_state(struct eps_cpu_data *centaur, rdmsr(MSR_IA32_PERF_STATUS, lo, hi); i++; if (unlikely(i > 64)) { - err = -ENODEV; - goto postchange; + return -ENODEV; } } /* Set new multiplier and voltage */ @@ -137,16 +130,10 @@ static int eps_set_state(struct eps_cpu_data *centaur, rdmsr(MSR_IA32_PERF_STATUS, lo, hi); i++; if (unlikely(i > 64)) { - err = -ENODEV; - goto postchange; + return -ENODEV; } } while (lo & ((1 << 16) | (1 << 17))); - /* Return current frequency */ -postchange: - rdmsr(MSR_IA32_PERF_STATUS, lo, hi); - freqs.new = centaur->fsb * ((lo >> 8) & 0xff); - #ifdef DEBUG { u8 current_multiplier, current_voltage; @@ -161,11 +148,7 @@ postchange: current_multiplier); } #endif - if (err) - freqs.new = freqs.old; - - cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE); - return err; + return 0; } static int eps_target(struct cpufreq_policy *policy, unsigned int index)