From patchwork Thu Dec 4 04:11:56 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 41898 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ee0-f70.google.com (mail-ee0-f70.google.com [74.125.83.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id CFD9425E88 for ; Thu, 4 Dec 2014 04:13:44 +0000 (UTC) Received: by mail-ee0-f70.google.com with SMTP id b57sf10506061eek.1 for ; Wed, 03 Dec 2014 20:13:44 -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=c1db+/SsroRZC+SOsuTxhZh/XcDiImqsH6RPvajTNSY=; b=MbeHoop3DG1r6AhMOryW6gUZhs4tDQPBf1Jc9XAU9MvcpWrdLKxkMKo3n+DHkFdLmF CN2zgjVl2mU6nMV/rutebAVsmsyxsfoQ1YXEDPTnAl7mwU/Y192lhn3JHLmH8leOCyJt 2AHS8oDs7y85e23WO3hAB2FK5e+eLrDXMoTin/CJDneyGjXMG10LkamZ05Hkac2Q+ZAl UuuDhCY9LyuCQh3Z2smL8Mjjzvyo2+V71R0byldO6DZprrQ4f4VeQL17KWqYAfseO184 HvV3OMRUtcV/treNcxynE1crpQVM1IomHPnskTNCQl/b6sZHLU2ggHRodp60XrSexg70 FMFg== X-Gm-Message-State: ALoCoQmko5QXI+nlRFuXAPD/M6uEbFZTncjJfgEgRdSWsohxJQ/af/TRgPPBfj+69vHFVn5g+brJ X-Received: by 10.112.168.228 with SMTP id zz4mr1788482lbb.7.1417666424057; Wed, 03 Dec 2014 20:13:44 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.37.6 with SMTP id u6ls212579laj.26.gmail; Wed, 03 Dec 2014 20:13:43 -0800 (PST) X-Received: by 10.112.162.101 with SMTP id xz5mr7122269lbb.49.1417666423920; Wed, 03 Dec 2014 20:13:43 -0800 (PST) Received: from mail-lb0-f172.google.com (mail-lb0-f172.google.com. [209.85.217.172]) by mx.google.com with ESMTPS id s4si24593899las.118.2014.12.03.20.13.43 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 03 Dec 2014 20:13:43 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.172 as permitted sender) client-ip=209.85.217.172; Received: by mail-lb0-f172.google.com with SMTP id u10so13414291lbd.31 for ; Wed, 03 Dec 2014 20:13:43 -0800 (PST) X-Received: by 10.152.21.66 with SMTP id t2mr7119592lae.27.1417666423785; Wed, 03 Dec 2014 20:13:43 -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 ew9csp781070lbc; Wed, 3 Dec 2014 20:13:42 -0800 (PST) X-Received: by 10.70.138.37 with SMTP id qn5mr15081812pdb.118.1417666421412; Wed, 03 Dec 2014 20:13:41 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id df1si18139882pdb.237.2014.12.03.20.13.40 for ; Wed, 03 Dec 2014 20:13:41 -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 S1752998AbaLDENk (ORCPT + 12 others); Wed, 3 Dec 2014 23:13:40 -0500 Received: from mail-pa0-f49.google.com ([209.85.220.49]:49389 "EHLO mail-pa0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752995AbaLDENj (ORCPT ); Wed, 3 Dec 2014 23:13:39 -0500 Received: by mail-pa0-f49.google.com with SMTP id eu11so17074561pac.22 for ; Wed, 03 Dec 2014 20:13:39 -0800 (PST) X-Received: by 10.69.20.74 with SMTP id ha10mr22097438pbd.122.1417666419401; Wed, 03 Dec 2014 20:13:39 -0800 (PST) Received: from localhost ([122.166.92.172]) by mx.google.com with ESMTPSA id v5sm24562617pdn.20.2014.12.03.20.13.38 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 03 Dec 2014 20:13:38 -0800 (PST) From: Viresh Kumar To: linux-pm@vger.kernel.org, edubezval@gmail.com Cc: linaro-kernel@lists.linaro.org, rui.zhang@intel.com, amit.daniel@samsung.com, javi.merino@arm.com, Viresh Kumar Subject: [PATCH V2 14/26] thermal: cpu_cooling: don't iterate over all allowed_cpus to update cpufreq policy Date: Thu, 4 Dec 2014 09:41:56 +0530 Message-Id: <07ca368899ab998090119eabdd70c3336356d836.1417664938.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.172 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 f325738..7f27f1b 100644 --- a/drivers/thermal/cpu_cooling.c +++ b/drivers/thermal/cpu_cooling.c @@ -285,11 +285,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; @@ -301,10 +300,8 @@ static int cpufreq_apply_cooling(struct cpufreq_cooling_device *cpufreq_device, cpufreq_device->cpufreq_state = cooling_state; cpufreq_device->cpufreq_val = clip_freq; - for_each_cpu(cpuid, mask) { - if (is_cpufreq_valid(cpuid)) - cpufreq_update_policy(cpuid); - } + if (is_cpufreq_valid(cpu)) + cpufreq_update_policy(cpu); return 0; }