From patchwork Fri Sep 13 13:01:10 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 20178 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 1CDCB20358 for ; Fri, 13 Sep 2013 13:17:44 +0000 (UTC) Received: by mail-ye0-f200.google.com with SMTP id r3sf1158953yen.11 for ; Fri, 13 Sep 2013 06:17:43 -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=Leiaxtv3SiHDaJLTQeuhKXmB7nzKrFrie2GxDrW1gC8=; b=kRcrqfcqu7N9xgrYvDlF555gidPsHDPfAuTgVQHB520W+kjCLCgGsmQ4kxkKdXAM8w g+qe1MbEy8jBLeqb1bcTGMSYzkM0jEIEOEjJl8YGT01ZJsxrNDLHOC/McIYmNLfzuWkl HKhablWvaBj3PNQydHrnCUFfiyW8CLxL+dBTWub/83G4P5/NJcUQGlYE9Ka8SkMPQ7bN zDyBI2XKpGry18B2ZqmKGfBjjSSDuI7BWMcQwzMRAsbJsRgoP+JoseVuUq0X652vIPCb eJvGp/UYJfdGhP3YEmEiT3UctNOYUUHbjQJbSQ1gyZXaSjPN5vPJt5W1hx+2pD31Gws+ i/4g== X-Gm-Message-State: ALoCoQkjkIb59OoSCa4QhAxzNVsuasCgp+YM3bExrrwo3ShQEqY7RCsD7BRotqX+AwrTI9el3N3F X-Received: by 10.236.115.198 with SMTP id e46mr5417253yhh.33.1379078263831; Fri, 13 Sep 2013 06:17:43 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.117.69 with SMTP id kc5ls1130409qeb.42.gmail; Fri, 13 Sep 2013 06:17:43 -0700 (PDT) X-Received: by 10.221.47.193 with SMTP id ut1mr11978318vcb.8.1379078263582; Fri, 13 Sep 2013 06:17:43 -0700 (PDT) Received: from mail-vc0-f178.google.com (mail-vc0-f178.google.com [209.85.220.178]) by mx.google.com with ESMTPS id oh2si3109178vcb.85.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:17:43 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.178 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.178; Received: by mail-vc0-f178.google.com with SMTP id ha12so939623vcb.9 for ; Fri, 13 Sep 2013 06:17:43 -0700 (PDT) X-Received: by 10.220.74.69 with SMTP id t5mr12043500vcj.18.1379078263463; Fri, 13 Sep 2013 06:17:43 -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 u4csp80181vcz; Fri, 13 Sep 2013 06:17:42 -0700 (PDT) X-Received: by 10.68.194.161 with SMTP id hx1mr8723216pbc.164.1379078262566; Fri, 13 Sep 2013 06:17:42 -0700 (PDT) Received: from mail-pb0-f43.google.com (mail-pb0-f43.google.com [209.85.160.43]) by mx.google.com with ESMTPS id hb3si11144663pac.326.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:17:42 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.43 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.160.43; Received: by mail-pb0-f43.google.com with SMTP id md4so1226690pbc.16 for ; Fri, 13 Sep 2013 06:17:41 -0700 (PDT) X-Received: by 10.68.253.161 with SMTP id ab1mr13398520pbd.76.1379078261874; Fri, 13 Sep 2013 06:17:41 -0700 (PDT) Received: from localhost ([122.167.78.148]) by mx.google.com with ESMTPSA id fa4sm18039646pab.17.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:17:41 -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 124/228] cpufreq: speedstep: don't initialize part of policy that is set by core too Date: Fri, 13 Sep 2013 18:31:10 +0530 Message-Id: <3ea9c6cfddb691784394460150aced29ea6783f5.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.178 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: , Many common initializations of struct policy are moved to core now and hence this driver doesn't need to do it. This patch removes such code. Most recent of those changes is to call ->get() in the core after calling ->init(). Cc: David S. Miller Signed-off-by: Viresh Kumar --- drivers/cpufreq/speedstep-centrino.c | 5 ----- drivers/cpufreq/speedstep-ich.c | 15 +-------------- drivers/cpufreq/speedstep-smi.c | 13 ------------- 3 files changed, 1 insertion(+), 32 deletions(-) diff --git a/drivers/cpufreq/speedstep-centrino.c b/drivers/cpufreq/speedstep-centrino.c index c7c14ae..6b882c7 100644 --- a/drivers/cpufreq/speedstep-centrino.c +++ b/drivers/cpufreq/speedstep-centrino.c @@ -343,7 +343,6 @@ static unsigned int get_cur_freq(unsigned int cpu) static int centrino_cpu_init(struct cpufreq_policy *policy) { struct cpuinfo_x86 *cpu = &cpu_data(policy->cpu); - unsigned freq; unsigned l, h; int i; @@ -394,12 +393,8 @@ static int centrino_cpu_init(struct cpufreq_policy *policy) } } - freq = get_cur_freq(policy->cpu); policy->cpuinfo.transition_latency = 10000; /* 10uS transition latency */ - policy->cur = freq; - - pr_debug("centrino_cpu_init: cur=%dkHz\n", policy->cur); return cpufreq_table_validate_and_show(policy, per_cpu(centrino_model, policy->cpu)->op_points); diff --git a/drivers/cpufreq/speedstep-ich.c b/drivers/cpufreq/speedstep-ich.c index 929a4f0..1a8b01b 100644 --- a/drivers/cpufreq/speedstep-ich.c +++ b/drivers/cpufreq/speedstep-ich.c @@ -308,7 +308,7 @@ static void get_freqs_on_cpu(void *_get_freqs) static int speedstep_cpu_init(struct cpufreq_policy *policy) { - unsigned int policy_cpu, speed; + unsigned int policy_cpu; struct get_freqs gf; /* only run on CPU to be set, or on its sibling */ @@ -323,19 +323,6 @@ static int speedstep_cpu_init(struct cpufreq_policy *policy) if (gf.ret) return gf.ret; - /* get current speed setting */ - speed = speedstep_get(policy_cpu); - if (!speed) - return -EIO; - - pr_debug("currently at %s speed setting - %i MHz\n", - (speed == speedstep_freqs[SPEEDSTEP_LOW].frequency) - ? "low" : "high", - (speed / 1000)); - - /* cpuinfo and default policy values */ - policy->cur = speed; - return cpufreq_table_validate_and_show(policy, speedstep_freqs); } diff --git a/drivers/cpufreq/speedstep-smi.c b/drivers/cpufreq/speedstep-smi.c index b3dfba0..a02b649 100644 --- a/drivers/cpufreq/speedstep-smi.c +++ b/drivers/cpufreq/speedstep-smi.c @@ -267,7 +267,6 @@ static int speedstep_target(struct cpufreq_policy *policy, static int speedstep_cpu_init(struct cpufreq_policy *policy) { int result; - unsigned int speed, state; unsigned int *low, *high; /* capability check */ @@ -303,19 +302,7 @@ static int speedstep_cpu_init(struct cpufreq_policy *policy) pr_debug("workaround worked.\n"); } - /* get current speed setting */ - state = speedstep_get_state(); - speed = speedstep_freqs[state].frequency; - - pr_debug("currently at %s speed setting - %i MHz\n", - (speed == speedstep_freqs[SPEEDSTEP_LOW].frequency) - ? "low" : "high", - (speed / 1000)); - - /* cpuinfo and default policy values */ policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL; - policy->cur = speed; - return cpufreq_table_validate_and_show(policy, speedstep_freqs); }