From patchwork Fri Jun 3 12:16:57 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Santosh Shilimkar X-Patchwork-Id: 846512 X-Patchwork-Delegate: khilman@deeprootsystems.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p53CCQkN025677 for ; Fri, 3 Jun 2011 12:21:41 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753000Ab1FCMRE (ORCPT ); Fri, 3 Jun 2011 08:17:04 -0400 Received: from bear.ext.ti.com ([192.94.94.41]:60709 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751797Ab1FCMRD (ORCPT ); Fri, 3 Jun 2011 08:17:03 -0400 Received: from dbdp20.itg.ti.com ([172.24.170.38]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id p53CGxYo027551 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 3 Jun 2011 07:17:01 -0500 Received: from dbde70.ent.ti.com (localhost [127.0.0.1]) by dbdp20.itg.ti.com (8.13.8/8.13.8) with ESMTP id p53CGwWh021086; Fri, 3 Jun 2011 17:46:59 +0530 (IST) Received: from dbdp31.itg.ti.com (172.24.170.98) by DBDE70.ent.ti.com (172.24.170.148) with Microsoft SMTP Server id 8.3.106.1; Fri, 3 Jun 2011 17:46:58 +0530 Received: from linfarm476.india.ti.com (dbdp20.itg.ti.com [172.24.170.38]) by dbdp31.itg.ti.com (8.13.8/8.13.8) with ESMTP id p53CGvAJ002050; Fri, 3 Jun 2011 17:46:58 +0530 (IST) Received: from linfarm476.india.ti.com (localhost [127.0.0.1]) by linfarm476.india.ti.com (8.12.11/8.12.11) with ESMTP id p53CGvqc022760; Fri, 3 Jun 2011 17:46:57 +0530 Received: (from a0393909@localhost) by linfarm476.india.ti.com (8.12.11/8.12.11/Submit) id p53CGvGg022758; Fri, 3 Jun 2011 17:46:57 +0530 From: Santosh Shilimkar To: CC: Santosh Shilimkar , Kevin Hilman Subject: [PATCH][pm-wip/cpufreq] OMAP2+: CPUfreq: Remove superfluous check in target() for online CPU's. Date: Fri, 3 Jun 2011 17:46:57 +0530 Message-ID: <1307103417-22721-1-git-send-email-santosh.shilimkar@ti.com> X-Mailer: git-send-email 1.5.6.6 MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Fri, 03 Jun 2011 12:21:44 +0000 (UTC) Current OMAP2PLUS CPUfreq tagret() functions returns when all the CPU's are not online. This breaks CPUfreq when secondary CPUs are offlined on SMP system. The intention of that check was just avoid CPU frequency change during the window when CPU becomes online but it's cpufreq_init is not done yet. Otherwise it can lead to notifiers being sent on a CPU which is not yet registered to the governor. But this race conditions is already managed by the CPUfreq core driver by updating the available cpumask accordingly. OMAP CPUFReq driver make use same cpumask for the notifiers so the above problem doesn't exist. In my initial implementation of the OMAP4 CPUFreq driver, I was using 'for_each_online_cpu()' for notifiers which lead me to add that check. Later I fixed the notifies but didn't realise that the check has become redundant then. Fix it by removing the superfluous check in target(). Thanks for Nishant Menon for reporting issue with hot-plug and Kevin Hilman for his comment on excessive check in target(). Signed-off-by: Santosh Shilimkar Reported-by: Nishanth Menon Tested-by: Vishwanath BS Cc: Kevin Hilman Tested-by: Nishanth Menon --- This change is an outcome of discussion on another patch to fix the hot-plug issue. For details refer below thread: http://www.mail-archive.com/linux-omap@vger.kernel.org/msg50348.html arch/arm/mach-omap2/omap2plus-cpufreq.c | 4 ---- 1 files changed, 0 insertions(+), 4 deletions(-) diff --git a/arch/arm/mach-omap2/omap2plus-cpufreq.c b/arch/arm/mach-omap2/omap2plus-cpufreq.c index 33a91ec..3bf1704 100644 --- a/arch/arm/mach-omap2/omap2plus-cpufreq.c +++ b/arch/arm/mach-omap2/omap2plus-cpufreq.c @@ -81,10 +81,6 @@ static int omap_target(struct cpufreq_policy *policy, int i, ret = 0; struct cpufreq_freqs freqs; - /* Changes not allowed until all CPUs are online */ - if (is_smp() && (num_online_cpus() < NR_CPUS)) - return ret; - /* Ensure desired rate is within allowed range. Some govenors * (ondemand) will just pass target_freq=0 to get the minimum. */ if (target_freq < policy->min)