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: 230574 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [IPv6:::1]) by ozlabs.org (Postfix) with ESMTP id 10ADE2C0118 for ; Mon, 25 Mar 2013 16:19:59 +1100 (EST) Received: from mail-oa0-f50.google.com (mail-oa0-f50.google.com [209.85.219.50]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority" (not verified)) by ozlabs.org (Postfix) with ESMTPS id C1B412C009F for ; Mon, 25 Mar 2013 16:19:08 +1100 (EST) Received: by mail-oa0-f50.google.com with SMTP id n1so3254668oag.9 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=lNjbst4fa7HCtU+wMpb83/46UaiIrzi22WBHSuFtYb0tAhtWDabr/bOaTWRwUk7Mir IsVDK4MlCdK/8LES4nzkfs+J41SGPwV6evV9GIAcUmn5L6Xd/rVVYrDnktbl+62Qotqp /NXGLi4uSEvqKbwHpmGtIvtZ+ocZy6VjQREYH3bkhW3kuBgaCKW8DUxevTnntoBMHvZJ H8ZWkewXkIX1fqBo+Vrz8GqYdEHPsAhVvaLsswbpn1OEz8UxE4TuD3glMsqwCxroi6ip lNzPlFMpXprXGhge7P3kHCatZYZR3BSwDh2+KulMlKgsA1rA1TiAbVVAiSAQU0J7g2tp p6GA== 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: ALoCoQkAjxiZNwwHGjG6fS0XueHb4g6TQUDZst2GobdjyXMNrJnF/u/mJcrVwNfGnugnemFdNPQD 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, 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: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" 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;