From patchwork Fri Aug 16 02:25:30 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 19206 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f200.google.com (mail-ve0-f200.google.com [209.85.128.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5635B2486D for ; Fri, 16 Aug 2013 02:30:03 +0000 (UTC) Received: by mail-ve0-f200.google.com with SMTP id oz10sf1871811veb.3 for ; Thu, 15 Aug 2013 19:30:03 -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=99VDD1QYwOyIrxQdsUDoRhQfnGc4ZKgKTGIBdV2jblY=; b=QrkztFzUYfIAmw7qA45lX6Mj4zVaNTKXgwhN3KCDaEyrqupmYsEPy6ppDt2ZGYIKLq e4YDIa2WzKLXhmpinVxd6gtEcR0zJokVL3uhxkwdDUd/CKOvBSg9pUBwPipWEfxLfj7P s5mVfZC4ftN696IGiguFcxB8ZAKRCd++dcBvGw2vzff+0HeXolK8MoaPgR4J7dmtsNbq aa3J9nHe9OczhnG+1cnWpR6FEg8+EVX+H8IOvNCdks4BLJUadSk9yJoXYxwU436rzm2W VTZ7gqsrb5y46aW4zSiJevej42yQvV+BTG17Urdf3AkjJlP76S9+f+wipoHPyfZts5Jx S0CQ== X-Received: by 10.236.163.67 with SMTP id z43mr354744yhk.27.1376620203071; Thu, 15 Aug 2013 19:30:03 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.41.40 with SMTP id c8ls658680qel.72.gmail; Thu, 15 Aug 2013 19:30:02 -0700 (PDT) X-Received: by 10.52.120.7 with SMTP id ky7mr14612117vdb.12.1376620202420; Thu, 15 Aug 2013 19:30:02 -0700 (PDT) Received: from mail-vc0-f174.google.com (mail-vc0-f174.google.com [209.85.220.174]) by mx.google.com with ESMTPS id xt2si687575vcb.108.2013.08.15.19.30.02 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 15 Aug 2013 19:30:02 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.174 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.174; Received: by mail-vc0-f174.google.com with SMTP id gd11so1063369vcb.19 for ; Thu, 15 Aug 2013 19:30:02 -0700 (PDT) X-Gm-Message-State: ALoCoQlBuDP9ZVviTVo/IvmHixX3BDBvR9LRLQfUy/EfxjsF5Ib0xTL+W8Ve1QW4IzLM0zA5Q35H X-Received: by 10.58.165.70 with SMTP id yw6mr17382463veb.19.1376620202328; Thu, 15 Aug 2013 19:30:02 -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 u4csp45288vcz; Thu, 15 Aug 2013 19:30:01 -0700 (PDT) X-Received: by 10.68.186.193 with SMTP id fm1mr10846917pbc.163.1376620201485; Thu, 15 Aug 2013 19:30:01 -0700 (PDT) Received: from mail-pd0-f173.google.com (mail-pd0-f173.google.com [209.85.192.173]) by mx.google.com with ESMTPS id rt3si1650184pbc.233.2013.08.15.19.30.01 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 15 Aug 2013 19:30:01 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.192.173 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.192.173; Received: by mail-pd0-f173.google.com with SMTP id p10so1595658pdj.32 for ; Thu, 15 Aug 2013 19:30:01 -0700 (PDT) X-Received: by 10.66.149.73 with SMTP id ty9mr664432pab.36.1376620201108; Thu, 15 Aug 2013 19:30:01 -0700 (PDT) Received: from localhost ([122.172.193.46]) by mx.google.com with ESMTPSA id xs1sm128178pac.7.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 15 Aug 2013 19:30:00 -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 , "David S. Miller" Subject: [PATCH 33/34] cpufreq: speedstep: remove calls to cpufreq_notify_transition() Date: Fri, 16 Aug 2013 07:55:30 +0530 Message-Id: <8602c77300aa5a535cf95df8eb884cc5f3b9c0ba.1376619363.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.174 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: David S. Miller Signed-off-by: Viresh Kumar --- drivers/cpufreq/speedstep-centrino.c | 20 +------------------- drivers/cpufreq/speedstep-ich.c | 9 --------- drivers/cpufreq/speedstep-smi.c | 7 ------- 3 files changed, 1 insertion(+), 35 deletions(-) diff --git a/drivers/cpufreq/speedstep-centrino.c b/drivers/cpufreq/speedstep-centrino.c index b7a2f8d..90b4581 100644 --- a/drivers/cpufreq/speedstep-centrino.c +++ b/drivers/cpufreq/speedstep-centrino.c @@ -424,9 +424,8 @@ static int centrino_cpu_exit(struct cpufreq_policy *policy) static int centrino_target(struct cpufreq_policy *policy, unsigned int index) { unsigned int msr, oldmsr = 0, h = 0, cpu = policy->cpu; - struct cpufreq_freqs freqs; int retval = 0; - unsigned int j, first_cpu, tmp; + unsigned int j, first_cpu; struct cpufreq_frequency_table *op_points; cpumask_var_t covered_cpus; @@ -474,15 +473,6 @@ static int centrino_target(struct cpufreq_policy *policy, unsigned int index) goto out; } - freqs.old = extract_clock(oldmsr, cpu, 0); - freqs.new = extract_clock(msr, cpu, 0); - - pr_debug("target=%dkHz old=%d new=%d msr=%04x\n", - op_points->frequency, freqs.old, freqs.new, msr); - - cpufreq_notify_transition(policy, &freqs, - CPUFREQ_PRECHANGE); - first_cpu = 0; /* all but 16 LSB are reserved, treat them with care */ oldmsr &= ~0xffff; @@ -497,8 +487,6 @@ static int centrino_target(struct cpufreq_policy *policy, unsigned int index) cpumask_set_cpu(j, covered_cpus); } - cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE); - if (unlikely(retval)) { /* * We have failed halfway through the frequency change. @@ -509,12 +497,6 @@ static int centrino_target(struct cpufreq_policy *policy, unsigned int index) for_each_cpu(j, covered_cpus) wrmsr_on_cpu(j, MSR_IA32_PERF_CTL, oldmsr, h); - - tmp = freqs.new; - freqs.new = freqs.old; - freqs.old = tmp; - cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE); - cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE); } retval = 0; diff --git a/drivers/cpufreq/speedstep-ich.c b/drivers/cpufreq/speedstep-ich.c index 707721e..7639b2b 100644 --- a/drivers/cpufreq/speedstep-ich.c +++ b/drivers/cpufreq/speedstep-ich.c @@ -258,21 +258,12 @@ static unsigned int speedstep_get(unsigned int cpu) static int speedstep_target(struct cpufreq_policy *policy, unsigned int index) { unsigned int policy_cpu; - struct cpufreq_freqs freqs; policy_cpu = cpumask_any_and(policy->cpus, cpu_online_mask); - freqs.old = speedstep_get(policy_cpu); - freqs.new = speedstep_freqs[index].frequency; - - pr_debug("transiting from %u to %u kHz\n", freqs.old, freqs.new); - - cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE); smp_call_function_single(policy_cpu, _speedstep_set_state, &index, true); - cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE); - return 0; } diff --git a/drivers/cpufreq/speedstep-smi.c b/drivers/cpufreq/speedstep-smi.c index 19446e4..0f5326d 100644 --- a/drivers/cpufreq/speedstep-smi.c +++ b/drivers/cpufreq/speedstep-smi.c @@ -241,14 +241,7 @@ static void speedstep_set_state(unsigned int state) */ static int speedstep_target(struct cpufreq_policy *policy, unsigned int index) { - struct cpufreq_freqs freqs; - - freqs.old = speedstep_freqs[speedstep_get_state()].frequency; - freqs.new = speedstep_freqs[index].frequency; - - cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE); speedstep_set_state(index); - cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE); return 0; }