From patchwork Fri Nov 28 09:44:07 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 41680 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f198.google.com (mail-lb0-f198.google.com [209.85.217.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 7820B244C2 for ; Fri, 28 Nov 2014 09:45:32 +0000 (UTC) Received: by mail-lb0-f198.google.com with SMTP id p9sf3883700lbv.9 for ; Fri, 28 Nov 2014 01:45:31 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:in-reply-to:references :sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=aTcPXK3O0N3puwTGr7I4qzkyIZOXw9weFXBpEuaXKAA=; b=HdgmpE7p69CV+H2Y7HYnjcFurrnyVQdv5gluuO80Fba8Q95aQkXuRr+yw7sEg8n8MF tiAz4QYzSzkHCtY/T7xBXP0Od//e+mXd934Wkt+Ne7YNXZFWAAT+g3yRVLmACqCabfQb UpqMNMNglMKN6v2Oocs0Dv/LwkMPJ63Lxdu4ag8eWhiWiV30Wqy8jU65hAPLOf7x+tvl CT8P3+JsUhcB1mz6svA/vzUij9NTgTUTvyz0K5GxcSyhL3MFPv98Hbyi26a4cWe3OmB3 8V+f30ESDvlut/DfsWanoounZoAjxNn85cx+ZWTDviEqDOAEyvHMSVgDgreWrgMDTP70 Wchw== X-Gm-Message-State: ALoCoQmc7iIk1Otlkhl+odjLLJbCtR43h3vMfc/3SpeGgEbbNQZWOJ/pJQnmVFVMcmAe5gT/nhia X-Received: by 10.194.176.106 with SMTP id ch10mr161561wjc.6.1417167931174; Fri, 28 Nov 2014 01:45:31 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.43.17 with SMTP id s17ls640866lal.52.gmail; Fri, 28 Nov 2014 01:45:30 -0800 (PST) X-Received: by 10.112.150.71 with SMTP id ug7mr42981402lbb.73.1417167930924; Fri, 28 Nov 2014 01:45:30 -0800 (PST) Received: from mail-lb0-f177.google.com (mail-lb0-f177.google.com. [209.85.217.177]) by mx.google.com with ESMTPS id rg7si9410623lbb.135.2014.11.28.01.45.30 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 28 Nov 2014 01:45:30 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.177 as permitted sender) client-ip=209.85.217.177; Received: by mail-lb0-f177.google.com with SMTP id 10so5346296lbg.36 for ; Fri, 28 Nov 2014 01:45:30 -0800 (PST) X-Received: by 10.112.189.10 with SMTP id ge10mr42375914lbc.23.1417167930844; Fri, 28 Nov 2014 01:45:30 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.184.201 with SMTP id ew9csp60450lbc; Fri, 28 Nov 2014 01:45:29 -0800 (PST) X-Received: by 10.70.49.48 with SMTP id r16mr28341340pdn.103.1417167929214; Fri, 28 Nov 2014 01:45:29 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id vj10si15336419pbc.138.2014.11.28.01.45.28 for ; Fri, 28 Nov 2014 01:45:29 -0800 (PST) Received-SPF: none (google.com: linux-pm-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751745AbaK1Jp1 (ORCPT + 12 others); Fri, 28 Nov 2014 04:45:27 -0500 Received: from mail-pa0-f53.google.com ([209.85.220.53]:38248 "EHLO mail-pa0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751677AbaK1Jp0 (ORCPT ); Fri, 28 Nov 2014 04:45:26 -0500 Received: by mail-pa0-f53.google.com with SMTP id kq14so6438298pab.26 for ; Fri, 28 Nov 2014 01:45:26 -0800 (PST) X-Received: by 10.70.89.237 with SMTP id br13mr72428786pdb.78.1417167925973; Fri, 28 Nov 2014 01:45:25 -0800 (PST) Received: from localhost ([122.167.111.40]) by mx.google.com with ESMTPSA id p10sm9387168pds.63.2014.11.28.01.45.24 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 28 Nov 2014 01:45:25 -0800 (PST) From: Viresh Kumar To: linux-pm@vger.kernel.org, edubezval@gmail.com Cc: linaro-kernel@lists.linaro.org, rui.zhang@intel.com, Viresh Kumar Subject: [PATCH 13/26] cpu_cooling: don't iterate over all allowed_cpus to update cpufreq policy Date: Fri, 28 Nov 2014 15:14:07 +0530 Message-Id: <52b233ae071b3f51d05e96f060ef35903e6c3b03.1417167599.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.0.3.693.g996b0fd In-Reply-To: References: In-Reply-To: References: Sender: linux-pm-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: viresh.kumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.177 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , All CPUs present in 'allowed_cpus' share the same 'struct cpufreq_policy' structure and so calling cpufreq_update_policy() for each of them doesn't make sense. Signed-off-by: Viresh Kumar --- drivers/thermal/cpu_cooling.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/thermal/cpu_cooling.c b/drivers/thermal/cpu_cooling.c index c358ede..8ca0380 100644 --- a/drivers/thermal/cpu_cooling.c +++ b/drivers/thermal/cpu_cooling.c @@ -286,11 +286,10 @@ static unsigned int get_cpu_frequency(unsigned int cpu, unsigned long level) static int cpufreq_apply_cooling(struct cpufreq_cooling_device *cpufreq_device, unsigned long cooling_state) { - unsigned int cpuid, clip_freq; + unsigned int clip_freq; struct cpumask *mask = &cpufreq_device->allowed_cpus; unsigned int cpu = cpumask_any(mask); - /* Check if the old cooling action is same as new cooling action */ if (cpufreq_device->cpufreq_state == cooling_state) return 0; @@ -303,10 +302,8 @@ static int cpufreq_apply_cooling(struct cpufreq_cooling_device *cpufreq_device, cpufreq_device->cpufreq_val = clip_freq; notify_device = cpufreq_device; - for_each_cpu(cpuid, mask) { - if (is_cpufreq_valid(cpuid)) - cpufreq_update_policy(cpuid); - } + if (is_cpufreq_valid(cpu)) + cpufreq_update_policy(cpu); notify_device = NOTIFY_INVALID;