From patchwork Fri Sep 13 13:02:16 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 20244 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ye0-f200.google.com (mail-ye0-f200.google.com [209.85.213.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4922120358 for ; Fri, 13 Sep 2013 13:25:39 +0000 (UTC) Received: by mail-ye0-f200.google.com with SMTP id r3sf1172317yen.7 for ; Fri, 13 Sep 2013 06:25:39 -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=VxWPT3cCKi5VGCbQvAeoN8odrFXZA1tJViC7s+CxFbs=; b=Sc4zDSYXPA5gSq+QdzymN/0mIvwm0k1MjSwIuKfKoZfqG7nh6GYRvglC5BE0WBrqVt Paf2TFje4Gdq2GHfEYGNYHr4RDo6khfzucZGj8kF6Wc7GJy4sICU4/dMd4I1PXnhXbYq 88yuhby3ehSoeJP0A67qWJMyn5/4ttVgRVUpX+m6KWcS4+yTVQeNjDqtJaEUHCe89VeI DakQA6n9EuiT1OLNVyPJ8ZPCoKX6Kr7bswSeqCJ9l9VFu/1DYwmsbgnCsbdAZhiPmCGF 9kCmRQa8Wtpc1X07FYE3wYAnfoZOlQ9eqw6MU2lHEVygwCnZ+RkJSQDDmOTU4pB/nWAJ 6+xQ== X-Gm-Message-State: ALoCoQmnu96jKmXKPFHBcr4qxrnoqLBT00aAZV+laFVk6FQiAk34rHUZaMch/8wHRvSI027PIId7 X-Received: by 10.58.34.237 with SMTP id c13mr854050vej.27.1379078739016; Fri, 13 Sep 2013 06:25:39 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.49.196 with SMTP id w4ls1118870qen.71.gmail; Fri, 13 Sep 2013 06:25:38 -0700 (PDT) X-Received: by 10.58.246.8 with SMTP id xs8mr12128884vec.9.1379078738815; Fri, 13 Sep 2013 06:25:38 -0700 (PDT) Received: from mail-ve0-f177.google.com (mail-ve0-f177.google.com [209.85.128.177]) by mx.google.com with ESMTPS id tm8si3107510vdc.111.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:25:38 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.177 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.177; Received: by mail-ve0-f177.google.com with SMTP id db12so933434veb.8 for ; Fri, 13 Sep 2013 06:25:38 -0700 (PDT) X-Received: by 10.52.232.165 with SMTP id tp5mr10023475vdc.11.1379078738722; Fri, 13 Sep 2013 06:25:38 -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 u4csp80624vcz; Fri, 13 Sep 2013 06:25:38 -0700 (PDT) X-Received: by 10.66.136.227 with SMTP id qd3mr15067861pab.113.1379078737822; Fri, 13 Sep 2013 06:25:37 -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 t8si7463791pbe.188.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:25:37 -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 bj1so2552318pad.28 for ; Fri, 13 Sep 2013 06:25:37 -0700 (PDT) X-Received: by 10.68.216.132 with SMTP id oq4mr862901pbc.143.1379078737402; Fri, 13 Sep 2013 06:25:37 -0700 (PDT) Received: from localhost ([122.167.78.148]) by mx.google.com with ESMTPSA id b4sm11763242pbc.22.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:25:36 -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 190/228] cpufreq: e_powersaver: remove calls to cpufreq_notify_transition() Date: Fri, 13 Sep 2013 18:32:16 +0530 Message-Id: <58d4f67e775d03bb77baa7108ffed7b1bf3fdb27.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.177 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)