From patchwork Fri Aug 9 04:04:47 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 18904 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f70.google.com (mail-qa0-f70.google.com [209.85.216.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 0A63525D87 for ; Fri, 9 Aug 2013 04:04:50 +0000 (UTC) Received: by mail-qa0-f70.google.com with SMTP id cd7sf1714905qab.5 for ; Thu, 08 Aug 2013 21:04:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-gm-message-state:delivered-to:mime-version:in-reply-to:references :date:message-id:subject:from:to:cc:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe:content-type; bh=XK8hwrlVcNLw0xC3UfaDZI+eJC9bNfhaCm3mLL5ahqA=; b=gUvX/TT92KfdSt1am++kJBpnHCnrKTM6h3EJrWnDvE3JNNVVyX4IAxUibhpkus63aN Z+mVds7CuQigvGuwwcgzseE3EnxoIZRycI1N6RD6SYcKTsgNVnPng/xOBMdmpNidnzbP LcGQxcA1F/8qUNfFtWWKOsXq5I+bL0xdHQ6JjpToeVxA3hvRRkXzKpTVER8txpJQEep5 fGhpGgIMIRa2mGA4YLUV+aUBRxxdnCIrg8d2FQp5OBkp/J/K4xDtn9Kl3wTRdtxzWQdR MgeCQ+WiGceczR6MSPZxx0/f64JGpIkDXmUVIjifOEiQGJN15Cq+rAmL9F/lB6U+pQyO HZ9g== X-Received: by 10.236.180.41 with SMTP id i29mr4638919yhm.1.1376021089459; Thu, 08 Aug 2013 21:04:49 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.24.233 with SMTP id x9ls1279860qef.46.gmail; Thu, 08 Aug 2013 21:04:49 -0700 (PDT) X-Received: by 10.221.57.71 with SMTP id wf7mr5827493vcb.77.1376021089328; Thu, 08 Aug 2013 21:04:49 -0700 (PDT) Received: from mail-ve0-f169.google.com (mail-ve0-f169.google.com [209.85.128.169]) by mx.google.com with ESMTPS id sy7si4107309vdc.1.2013.08.08.21.04.49 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 08 Aug 2013 21:04:49 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.169 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.169; Received: by mail-ve0-f169.google.com with SMTP id db10so3667303veb.14 for ; Thu, 08 Aug 2013 21:04:49 -0700 (PDT) X-Gm-Message-State: ALoCoQmQ/+7Nu3aPC5nx1KndRd+9XAE+evC+U4jn42Y+XlBVQ9G0Uii+7Bj8aQEoWl4kuTtrvqmz X-Received: by 10.220.164.202 with SMTP id f10mr5718505vcy.25.1376021089187; Thu, 08 Aug 2013 21:04:49 -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 u4csp51669vcz; Thu, 8 Aug 2013 21:04:48 -0700 (PDT) X-Received: by 10.60.117.34 with SMTP id kb2mr6848847oeb.54.1376021087840; Thu, 08 Aug 2013 21:04:47 -0700 (PDT) Received: from mail-oa0-f45.google.com (mail-oa0-f45.google.com [209.85.219.45]) by mx.google.com with ESMTPS id s9si6126231oem.42.2013.08.08.21.04.47 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 08 Aug 2013 21:04:47 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.219.45 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.219.45; Received: by mail-oa0-f45.google.com with SMTP id m1so6442624oag.32 for ; Thu, 08 Aug 2013 21:04:47 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.182.28.98 with SMTP id a2mr1751675obh.36.1376021087571; Thu, 08 Aug 2013 21:04:47 -0700 (PDT) Received: by 10.182.28.168 with HTTP; Thu, 8 Aug 2013 21:04:47 -0700 (PDT) In-Reply-To: References: <568f3dbd414b050bb2319d960fb5044a5aed8ee3.1375964117.git.viresh.kumar@linaro.org> <5203BCDD.40809@wwwdotorg.org> Date: Fri, 9 Aug 2013 09:34:47 +0530 Message-ID: Subject: Re: [PATCH 35/35] cpufreq: tegra: use cpufreq_table_validate_and_show() From: Viresh Kumar To: Stephen Warren Cc: rjw@sisk.pl, 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, Stephen Warren 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.169 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: , On 8 August 2013 21:37, Viresh Kumar wrote: > Its useless and the correct routine isn't called at all :) .. I will add that > additional patch and send it to you and will get this change out of this > commit. The two commits look like this now attached too in case you want to test: commit 9abdc9127b9f7f1e00c75694d15345843a60ff99 Author: Viresh Kumar Date: Thu Aug 8 16:40:32 2013 +0530 cpufreq: tegra: use cpufreq_table_validate_and_show() Lets use cpufreq_table_validate_and_show() instead of calling cpufreq_frequency_table_cpuinfo() and cpufreq_frequency_table_get_attr(). Cc: Stephen Warren Signed-off-by: Viresh Kumar --- drivers/cpufreq/tegra-cpufreq.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/cpufreq/tegra-cpufreq.c b/drivers/cpufreq/tegra-cpufreq.c index cd66b85..51752b3 100644 --- a/drivers/cpufreq/tegra-cpufreq.c +++ b/drivers/cpufreq/tegra-cpufreq.c @@ -215,8 +215,7 @@ static int tegra_cpu_init(struct cpufreq_policy *policy) clk_prepare_enable(emc_clk); clk_prepare_enable(cpu_clk); - cpufreq_frequency_table_cpuinfo(policy, freq_table); - cpufreq_frequency_table_get_attr(freq_table, policy->cpu); + cpufreq_table_validate_and_show(policy, freq_table); policy->cur = tegra_getspeed(policy->cpu); target_cpu_speed[policy->cpu] = policy->cur; commit f1bb1cab6130501251eee616280b88c0b49d96d7 Author: Viresh Kumar Date: Fri Aug 9 09:29:19 2013 +0530 cpufreq: tegra: fix implementation of ->exit() ->exit() of drivers should call cpufreq_frequency_table_put_attr() if they have called cpufreq_frequency_table_get_attr() earlier in init() and they aren't required to validate their cpufreq table in exit by calling cpufreq_frequency_table_cpuinfo(). Tegra's driver wasn't calling cpufreq_frequency_table_put_attr() and was calling cpufreq_frequency_table_cpuinfo() in exit. Fix both these issues in it. Signed-off-by: Viresh Kumar --- drivers/cpufreq/tegra-cpufreq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/cpufreq/tegra-cpufreq.c b/drivers/cpufreq/tegra-cpufreq.c index 51752b3..faf1ce5 100644 --- a/drivers/cpufreq/tegra-cpufreq.c +++ b/drivers/cpufreq/tegra-cpufreq.c @@ -232,7 +232,7 @@ static int tegra_cpu_init(struct cpufreq_policy *policy) static int tegra_cpu_exit(struct cpufreq_policy *policy) { - cpufreq_frequency_table_cpuinfo(policy, freq_table); + cpufreq_frequency_table_put_attr(policy->cpu); clk_disable_unprepare(emc_clk); return 0; }