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: 5402441 X-Patchwork-Delegate: eduardo.valentin@ti.com Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 774949F47A for ; Fri, 28 Nov 2014 09:45:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 93C4E20145 for ; Fri, 28 Nov 2014 09:45:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 72EE820123 for ; Fri, 28 Nov 2014 09:45:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751745AbaK1Jp1 (ORCPT ); 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-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=GabxRLx1j9f4I17IKuljHC6CIoZctksU8dus/5WCa5Y=; b=Dar6JW+C6i/8QdHBsqZnP1osuH2G5n5O5sEITIe2/DZVLSzGEfV3M0ZIzqjb/j55x4 W4NWEsPESs6zPy80Ix9BHlAK67ya3/t0yspnnHbuDTs2CLphMmKFpA419fSp7P50JdHg zzDn5Ad8L0+rJlVxGllGymN8ePyPUZH4pu2F1zbpFpHalEaI0ZzhrpqilyFVtMynbclZ Z4ayIV9N239pR4HMu+27PLT8Mt7GhxipoCwjItO4EQ8LkHOVzwDZw22UETvLBzDusvMF Pfk2D4uw6eSGSJL75Jqn+QToyGPLrjSQnl4Zz12gVCD9qtFp+O3qjrWkbE5EQF2b8lTG AxWg== X-Gm-Message-State: ALoCoQke6ETeQgJg49+XFChYyX17zhRv9EqmwNSeLUS8GJB0iC8atGxHrnh54Y1oODBbNUsYfOya 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: 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 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;