From patchwork Mon Mar 25 05:19:05 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 2328901 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 6CAFD3FD8C for ; Mon, 25 Mar 2013 05:22:17 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UJzoM-0001aH-Gl; Mon, 25 Mar 2013 05:19:10 +0000 Received: from mail-oa0-f47.google.com ([209.85.219.47]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UJzoI-0001Zy-Tz for linux-arm-kernel@lists.infradead.org; Mon, 25 Mar 2013 05:19:07 +0000 Received: by mail-oa0-f47.google.com with SMTP id o17so6113649oag.34 for ; Sun, 24 Mar 2013 22:19:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type:x-gm-message-state; bh=VxQSITry7NHprUgRg5qKnAglUv7A0K10IxqNK7dUtqU=; b=VzZDk8a+wYESSC6xXdt7Jakzd/ZCJ1UwfcgNPO1QdTxg5MUmyeNDY57so+kOJqZHum 3Qdme/qe3+xGf3Q9utjJa+OnJ/lNFEXSzwvo8w154RqggIbtKGEFlpcqC9Wk3Ow6EzXi OwSd6jj4IGFqoXg8wUkhRnK4V0eIbJoIIxPgZRS/TgT7SDZFlhch0vSost3+et8WiL4C nZgCwwJjlf0BUTjc2cy91wwFljtmdBnnAOwhLtybsGxk3dQ9zPD7uzsShgmAMut2ZGX+ FpY+H+3asFH7t4BxgMDficWJevU4RuE8z18HQWoNQomeoCWbQYs+OgSTLFhc/Qf4yizR JTww== MIME-Version: 1.0 X-Received: by 10.60.22.34 with SMTP id a2mr9757397oef.97.1364188745400; Sun, 24 Mar 2013 22:19:05 -0700 (PDT) Received: by 10.182.52.198 with HTTP; Sun, 24 Mar 2013 22:19:05 -0700 (PDT) In-Reply-To: <981c23bd4b2a14c346820685e1203ab7054378f8.1364132845.git.viresh.kumar@linaro.org> References: <981c23bd4b2a14c346820685e1203ab7054378f8.1364132845.git.viresh.kumar@linaro.org> Date: Mon, 25 Mar 2013 10:49:05 +0530 Message-ID: Subject: Re: [PATCH 1/2] cpufreq: Notify all policy->cpus in cpufreq_notify_transition() From: Viresh Kumar To: rjw@sisk.pl X-Gm-Message-State: ALoCoQnD0vNJzWXz3kRjuGQlx8TX9Oe8jGIrI803qKfslp23MuWPnPYyj4EH1qstosOB37tIMfBI X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130325_011907_055969_FFB18B8B X-CRM114-Status: GOOD ( 11.74 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.219.47 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: linux-mips@linux-mips.org, linux-ia64@vger.kernel.org, linux-sh@vger.kernel.org, Viresh Kumar , Liviu.Dudau@arm.com, sparclinux@vger.kernel.org, linaro-kernel@lists.linaro.org, Guan Xuetao , arvind.chauhan@arm.com, Hans-Christian Egtvedt , Jesper Nilsson , robin.randhawa@arm.com, Stephen Warren , cpufreq@vger.kernel.org, Benjamin Herrenschmidt , Haavard Skinnemoen , cbe-oss-dev@lists.ozlabs.org, Fenghua Yu , Steve.Bannister@arm.com, Mike Frysinger , Arnd Bergmann , linux-pm@vger.kernel.org, Sekhar Nori , Haojian Zhuang , Mikael Starvik , Kukjin Kim , Borislav Petkov , Ben Dooks , Thomas Renninger , linux-arm-kernel@lists.infradead.org, Tony Luck , Eric Miao , linux-cris-kernel@axis.com, linux-kernel@vger.kernel.org, Ralf Baechle , Paul Mundt , Sascha Hauer , charles.garcia-tobin@arm.com, linuxppc-dev@lists.ozlabs.org, "David S. Miller" 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 On 24 March 2013 19:18, Viresh Kumar wrote: > policy->cpus contains all online cpus that have single shared clock line. And > their frequencies are always updated together. > > Many SMP system's cpufreq drivers take care of this in individual drivers but > the best place for this code is in cpufreq core. > > This patch modifies cpufreq_notify_transition() to notify frequency change for > all cpus in policy->cpus and hence updates all users of this API. Another fixup for tegra: } Acked-by: Stephen Warren Tested-by: Stephen Warren diff --git a/arch/arm/mach-tegra/cpu-tegra.c b/arch/arm/mach-tegra/cpu-tegra.c index 3b441d6..11ca730 100644 --- a/arch/arm/mach-tegra/cpu-tegra.c +++ b/arch/arm/mach-tegra/cpu-tegra.c @@ -106,7 +106,8 @@ out: return ret; } -static int tegra_update_cpu_speed(unsigned long rate) +static int tegra_update_cpu_speed(struct cpufreq_policy *policy, + unsigned long rate) { int ret = 0; struct cpufreq_freqs freqs; @@ -179,7 +180,7 @@ static int tegra_target(struct cpufreq_policy *policy, target_cpu_speed[policy->cpu] = freq; - ret = tegra_update_cpu_speed(tegra_cpu_highest_speed()); + ret = tegra_update_cpu_speed(policy, tegra_cpu_highest_speed()); out: mutex_unlock(&tegra_cpu_lock); @@ -191,10 +192,12 @@ static int tegra_pm_notify(struct notifier_block *nb, unsigned long event, { mutex_lock(&tegra_cpu_lock); if (event == PM_SUSPEND_PREPARE) { + struct cpufreq_policy *policy = cpufreq_cpu_get(0); is_suspended = true; pr_info("Tegra cpufreq suspend: setting frequency to %d kHz\n", freq_table[0].frequency); - tegra_update_cpu_speed(freq_table[0].frequency); + tegra_update_cpu_speed(policy, freq_table[0].frequency); + cpufreq_cpu_put(policy); } else if (event == PM_POST_SUSPEND) { is_suspended = false;