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: 2841662 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 5031E9F294 for ; Fri, 9 Aug 2013 04:05:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6C8A9200CF for ; Fri, 9 Aug 2013 04:05:18 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 49B64200C5 for ; Fri, 9 Aug 2013 04:05:17 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1V7dwv-0007ZG-D3; Fri, 09 Aug 2013 04:05:13 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1V7dwt-0001ms-6F; Fri, 09 Aug 2013 04:05:11 +0000 Received: from mail-ob0-f178.google.com ([209.85.214.178]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1V7dwr-0001m4-3U for linux-arm-kernel@lists.infradead.org; Fri, 09 Aug 2013 04:05:09 +0000 Received: by mail-ob0-f178.google.com with SMTP id ef5so5965735obb.37 for ; Thu, 08 Aug 2013 21:04:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=XK8hwrlVcNLw0xC3UfaDZI+eJC9bNfhaCm3mLL5ahqA=; b=ihpbexoJkITxP4mikNbLa+YPCur75RnnFNgeEUKJwXlvv1WUWJuAumk/C6NCd+JV1E g62b2Ws0yHCRu0vzjr0zAApp5M8eIhv3A0rmOLf7pW3V3EAL5NFdh5SmpntZlYnJbh3H UTDloCqr3FaqwHFRpUYXOA/+cNM031xHhwqPTgPP0d87QZzJluBrWEB06/EPmXtplvfc H+4JBFTIeAlC3GqAn6gs4J5AQeP/Ixbf1Tdaq+Ocvy24YIErNC0tMeFsjqX9uToRNW70 d6b0y8o2aBAcQl5gsTwk+uupTGcovlkyfWdUi8R7olZSGuYE+lKGUhhuZ3S/bsTqJ3Z0 6zzw== X-Gm-Message-State: ALoCoQl6FADS4Cy/shz6Ei+ToLqdxbwEk3L+URUV+I2NWgRdWALsV9JZr7JMQ9NSiDxRUm+Utbr8 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130809_000509_260195_59FFE34D X-CRM114-Status: GOOD ( 20.31 ) X-Spam-Score: -2.6 (--) Cc: linaro-kernel@lists.linaro.org, Stephen Warren , linux-pm@vger.kernel.org, patches@linaro.org, linux-kernel@vger.kernel.org, cpufreq@vger.kernel.org, rjw@sisk.pl, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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; }