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: 5435131 X-Patchwork-Delegate: eduardo.valentin@ti.com Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 4E627BEEA8 for ; Thu, 4 Dec 2014 04:13:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7B485201EF for ; Thu, 4 Dec 2014 04:13:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id ABCED20265 for ; Thu, 4 Dec 2014 04:13:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752998AbaLDENk (ORCPT ); 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-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=/lTt0hFCU4LgX4AnKSbCpnWnrXEHy+bf84UPVrIczfA=; b=a9EWvFoH9fTA2CXSgtT7gmXaLAUMXJ7jkPm7ERxRS6XL58J4FYx7dz2hH6ZcbiN/ck FGS7R3uYij19bFbE5BDw7GZNoMedKWFxG6VH36/ZYIzIoXDVrGkbxC9D/mrsiSbzcv4h zY7VZnFaQ0qPtfv1kplf0YMQ25TmUDsH+jw3VebTb4ika8qxse2x7zHYUw8NcmBe1Wub 20Ur6nR5mSBI0uft6OcLw/DUvxetZqqoOGr7zQZKQuD+1x5gNaRZ5tF5jxpUwMTrnS86 Ag66mpdHAn+vzyU3i++KkIR2oLDPoepn+jkr2YqAmQmeHR/BaGftqfoPbGtBXlLp6ltr nr/g== X-Gm-Message-State: ALoCoQkiA/gzdYI+3npm5xwqYY4XKgeWuyIGrttp6YUGn7wNu1FFIXCRhI0rXNpPx2LYuiZHM5Ow 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: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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; }