From patchwork Wed Aug 14 13:32:24 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 19148 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f69.google.com (mail-qa0-f69.google.com [209.85.216.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 184AA2390D for ; Wed, 14 Aug 2013 13:37:09 +0000 (UTC) Received: by mail-qa0-f69.google.com with SMTP id bv4sf5419374qab.4 for ; Wed, 14 Aug 2013 06:37:08 -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=0r85aRv2K4Lv2FrxV65h19bvj+y++6vKWX0/8UoWQnU=; b=o4CadRPlNDge0KVmI2VCAlh3lTrh3Hbye3jWJ3akKkoGJxZ7PM38EAMvOsT44SPdwt ibtR0x6/IQqrQq+BZ6H/fAQyvqmBOS6UFh2QmStygZimFyqD4xGWrrTKVUfmQ9w8sPcJ uuXrN2unIuRWvA+ScwRWDqopBJ68OeNmSTpyhqbfZSEwUp8lpFFSKRaiQ2aA+8ABmu2M MRgBAgS9K1gUYGemgeSE3nk7MbWyqTcyCuas67oLWQeMojR0DrSdtLf82VlEntnjegqB umiej1bjWXUbRmrNG3lDIDf7zt/1yN7ABrnSXoNw8rfVxU92pL3Fjnab/CFeh9Zz1JC+ G5SA== X-Received: by 10.58.29.1 with SMTP id f1mr2530868veh.34.1376487428743; Wed, 14 Aug 2013 06:37:08 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.73.193 with SMTP id n1ls3272721qev.50.gmail; Wed, 14 Aug 2013 06:37:08 -0700 (PDT) X-Received: by 10.58.73.202 with SMTP id n10mr9784267vev.7.1376487428634; Wed, 14 Aug 2013 06:37:08 -0700 (PDT) Received: from mail-vc0-f180.google.com (mail-vc0-f180.google.com [209.85.220.180]) by mx.google.com with ESMTPS id mq14si11031472vcb.56.2013.08.14.06.37.08 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 14 Aug 2013 06:37:08 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.180 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.180; Received: by mail-vc0-f180.google.com with SMTP id gf11so5010689vcb.25 for ; Wed, 14 Aug 2013 06:37:08 -0700 (PDT) X-Gm-Message-State: ALoCoQlvAj+E9TBuXqD9kISKwEPlHElIVfLBAVxGL+fMsodcFOv28pQa38WdT0CpamyzO9nfw5xL X-Received: by 10.220.111.142 with SMTP id s14mr92863vcp.55.1376487428532; Wed, 14 Aug 2013 06:37:08 -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 u4csp213279vcz; Wed, 14 Aug 2013 06:37:08 -0700 (PDT) X-Received: by 10.68.137.231 with SMTP id ql7mr9988315pbb.37.1376487427698; Wed, 14 Aug 2013 06:37:07 -0700 (PDT) Received: from mail-pb0-f48.google.com (mail-pb0-f48.google.com [209.85.160.48]) by mx.google.com with ESMTPS id km7si28300772pbc.35.2013.08.14.06.37.07 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 14 Aug 2013 06:37:07 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.48 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.160.48; Received: by mail-pb0-f48.google.com with SMTP id ma3so9342328pbc.35 for ; Wed, 14 Aug 2013 06:37:07 -0700 (PDT) X-Received: by 10.66.248.198 with SMTP id yo6mr2951510pac.143.1376487427315; Wed, 14 Aug 2013 06:37:07 -0700 (PDT) Received: from localhost ([122.172.193.46]) by mx.google.com with ESMTPSA id sp4sm50339903pbc.45.2013.08.14.06.37.03 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 14 Aug 2013 06:37:06 -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, Viresh Kumar , "David S. Miller" Subject: [PATCH 35/37] cpufreq: speedstep: don't initialize part of policy that is set by core too Date: Wed, 14 Aug 2013 19:02:24 +0530 Message-Id: <52ec8dfc91702bada1c0b3367b264624fc1df042.1376486714.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.180 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 b309774..b7a2f8d 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 be63486..707721e 100644 --- a/drivers/cpufreq/speedstep-ich.c +++ b/drivers/cpufreq/speedstep-ich.c @@ -296,7 +296,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 */ @@ -311,19 +311,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 878e64b..19446e4 100644 --- a/drivers/cpufreq/speedstep-smi.c +++ b/drivers/cpufreq/speedstep-smi.c @@ -257,7 +257,6 @@ static int speedstep_target(struct cpufreq_policy *policy, unsigned int index) static int speedstep_cpu_init(struct cpufreq_policy *policy) { int result; - unsigned int speed, state; unsigned int *low, *high; /* capability check */ @@ -293,19 +292,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); }