From patchwork Sun Mar 24 14:53:27 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 230459 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 A218B2C00E5 for ; Mon, 25 Mar 2013 01:54:00 +1100 (EST) Received: from mail-ob0-x22f.google.com (mail-ob0-x22f.google.com [IPv6:2607:f8b0:4003:c01::22f]) (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 9D4392C009E for ; Mon, 25 Mar 2013 01:53:32 +1100 (EST) Received: by mail-ob0-f175.google.com with SMTP id va7so2132667obc.6 for ; Sun, 24 Mar 2013 07:53:27 -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=DEHLLQPBply29Lw4iZ5y/G2Ds7/+0GoD7pHmEEnan6w=; b=lHzt4FvoHRzSfncGGNs3fU4PW7wu4XY3ed4SitBQTZfhMXj7tov8ZnPkGnUV47IZoZ EQn2NBhGHfbxJHx8wML64gnqlzihYgIWb0hYkVFtpS01qyT9uZ7weRpwdCKMWaGVSXU5 yI5KbbHbZb5JbumeCDyiMpaD0eTsyvHYnCjcvuhShyYHJQAqdii1/XfvpNjSNcp53EzT rsuZQ28RfVKwNt2VFKqRPlm1xMujWE9UgEVHH2uI4LjilNJ9q16XwgIivi5C77qxSozI 8P/aR1nVjF/GuET4sCFC36WVtWYxzOvZDiPVazEBlfhyTxPyjf3Z30NKKw3TuUxGaFfb f6wQ== MIME-Version: 1.0 X-Received: by 10.60.10.34 with SMTP id f2mr7933774oeb.104.1364136807383; Sun, 24 Mar 2013 07:53:27 -0700 (PDT) Received: by 10.182.52.198 with HTTP; Sun, 24 Mar 2013 07:53:27 -0700 (PDT) In-Reply-To: <514F0FB0.8030109@gmail.com> References: <981c23bd4b2a14c346820685e1203ab7054378f8.1364132845.git.viresh.kumar@linaro.org> <514F0FB0.8030109@gmail.com> Date: Sun, 24 Mar 2013 20:23:27 +0530 Message-ID: Subject: Re: [PATCH 1/2] cpufreq: Notify all policy->cpus in cpufreq_notify_transition() From: Viresh Kumar To: Francesco Lavra , Fengguang Wu X-Gm-Message-State: ALoCoQk5ZG+iwrajSKXPAgafmMLq73OLzRwe7BNvkJgU2ICos3ETAM2lypiDpCHdcD+Jj82OVTYe Cc: linux-mips@linux-mips.org, linux-ia64@vger.kernel.org, linux-sh@vger.kernel.org, Liviu.Dudau@arm.com, Steve.Bannister@arm.com, sparclinux@vger.kernel.org, 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 , linaro-kernel@lists.linaro.org, Mike Frysinger , linux-pm@vger.kernel.org, Sekhar Nori , Guan Xuetao , Haojian Zhuang , rjw@sisk.pl, Kukjin Kim , Borislav Petkov , Ben Dooks , Thomas Renninger , linux-arm-kernel@lists.infradead.org, Mikael Starvik , 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 20:07, Francesco Lavra wrote: > On 03/24/2013 02:48 PM, 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. One thing about this work. I compiled it for ARM and Intel. Also this stuff is tested by "Fengguang Wu" automated build system. I am not sure if that builds all architectures or not. I tried to review my patch closely but their can be some minor mistakes. I thought of adding this in the patch details but forgot at last. Is their a simple way to compile stuff for all platforms? Sorry i am not aware of it :( >> diff --git a/arch/blackfin/mach-common/cpufreq.c b/arch/blackfin/mach-common/cpufreq.c >> + ret = cpu_set_cclk(policy->cpu, freqs.new * 1000); >> + if (ret != 0) { >> + WARN_ONCE(ret, "cpufreq set freq failed %d\n", ret); >> + break; > > This doesn't even compile, as the break statement isn't in the > for_each_online_cpu() loop anymore. I tried to review it very carefully but this situation was a bit tricky :) Thanks for trying it out. Following should fix it for you: commit 942ca8a6bc87e3c42beabc9102755136493e5355 Author: Viresh Kumar Date: Sun Mar 24 20:21:43 2013 +0530 fixup! cpufreq: Notify all policy->cpus in cpufreq_notify_transition() --- arch/blackfin/mach-common/cpufreq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) @Rafael: Let me add fixups for now, i will send final patch later after others also review their part. diff --git a/arch/blackfin/mach-common/cpufreq.c b/arch/blackfin/mach-common/cpufreq.c index 4e67368..995511e80 100644 --- a/arch/blackfin/mach-common/cpufreq.c +++ b/arch/blackfin/mach-common/cpufreq.c @@ -164,7 +164,7 @@ static int bfin_target(struct cpufreq_policy *policy, ret = cpu_set_cclk(policy->cpu, freqs.new * 1000); if (ret != 0) { WARN_ONCE(ret, "cpufreq set freq failed %d\n", ret); - break; + return ret; } #endif on_each_cpu(bfin_adjust_core_timer, &index, 1);