From patchwork Wed Nov 26 05:53:01 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 41525 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 4390425E72 for ; Wed, 26 Nov 2014 05:53:46 +0000 (UTC) Received: by mail-ee0-f70.google.com with SMTP id b57sf1475625eek.9 for ; Tue, 25 Nov 2014 21:53:45 -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=mh1KFkUUMj45Hps2tJ4TR8hrgxPp55pWokl840CUQ0Q=; b=U7vyzJwvzXnJDrCoWtyVOTr0oLxIZ9WMoRTCNCFfjShL1OlDsz9X8UzXB83W73F6Ss +l6MSqbghA8Tm7S7Z2TT6CDRdvO5cW1qp1yjbkOTCaiHpG27d3Pm5AJ4tROCsUJdfzps ZmidrryL46EDkwSypgAo3NhaRf7QWViequwV4JYcwT30oIugabrn0nj0Sb5rZ5Pzantq F0Lb6SjPDUPKXbRfoqaQoPWCgKP2oU5jiAw3/nDcHjJzN1Zfsjo8FWAljjKQXl9kzpDf 44/zcHxOSCEqG7JH3AASPrdQQFDWKqnZAEbku7DS4kHf85PMqFDHKyGjFnB/PGI1+Rup 75Xg== X-Gm-Message-State: ALoCoQngZx0YP9NDGsfiGJ/8ENWHqEI/OvRtC3iIkq5Hnpdp9nYhBrw9PRZyB21uFUuoMnNpN0WQ X-Received: by 10.112.17.65 with SMTP id m1mr17864lbd.16.1416981225468; Tue, 25 Nov 2014 21:53:45 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.1.100 with SMTP id 4ls442457lal.89.gmail; Tue, 25 Nov 2014 21:53:45 -0800 (PST) X-Received: by 10.112.180.198 with SMTP id dq6mr31490911lbc.56.1416981225259; Tue, 25 Nov 2014 21:53:45 -0800 (PST) Received: from mail-la0-f43.google.com (mail-la0-f43.google.com. [209.85.215.43]) by mx.google.com with ESMTPS id wt3si3327924lbb.44.2014.11.25.21.53.44 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 25 Nov 2014 21:53:44 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.43 as permitted sender) client-ip=209.85.215.43; Received: by mail-la0-f43.google.com with SMTP id q1so1900146lam.16 for ; Tue, 25 Nov 2014 21:53:44 -0800 (PST) X-Received: by 10.152.6.228 with SMTP id e4mr32084671laa.71.1416981224924; Tue, 25 Nov 2014 21:53:44 -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 ew9csp572438lbc; Tue, 25 Nov 2014 21:53:44 -0800 (PST) X-Received: by 10.66.249.163 with SMTP id yv3mr49445167pac.77.1416981223173; Tue, 25 Nov 2014 21:53:43 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id fl2si5023000pad.233.2014.11.25.21.53.42 for ; Tue, 25 Nov 2014 21:53:43 -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 S1752241AbaKZFxl (ORCPT + 12 others); Wed, 26 Nov 2014 00:53:41 -0500 Received: from mail-pa0-f50.google.com ([209.85.220.50]:45295 "EHLO mail-pa0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752230AbaKZFxl (ORCPT ); Wed, 26 Nov 2014 00:53:41 -0500 Received: by mail-pa0-f50.google.com with SMTP id bj1so2186489pad.9 for ; Tue, 25 Nov 2014 21:53:40 -0800 (PST) X-Received: by 10.66.221.71 with SMTP id qc7mr26899951pac.43.1416981220883; Tue, 25 Nov 2014 21:53:40 -0800 (PST) Received: from localhost ([122.167.111.40]) by mx.google.com with ESMTPSA id y10sm3146265pdq.15.2014.11.25.21.53.39 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 25 Nov 2014 21:53:40 -0800 (PST) From: Viresh Kumar To: Rafael Wysocki , edubezval@gmail.com Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, l.majewski@samsung.com, Viresh Kumar Subject: [PATCH 6/7] cpu_cooling: don't iterate over all allowed_cpus to update cpufreq policy Date: Wed, 26 Nov 2014 11:23:01 +0530 Message-Id: <51626b4b1eb041fb19a06a90865dd92268465ffd.1416980448.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.215.43 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 1193cc4..41f5728 100644 --- a/drivers/thermal/cpu_cooling.c +++ b/drivers/thermal/cpu_cooling.c @@ -272,11 +272,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; @@ -289,10 +288,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;