From patchwork Fri Jan 2 07:04:28 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 42679 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-we0-f199.google.com (mail-we0-f199.google.com [74.125.82.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 3FBBD26CD1 for ; Fri, 2 Jan 2015 07:05:28 +0000 (UTC) Received: by mail-we0-f199.google.com with SMTP id k11sf2043824wes.10 for ; Thu, 01 Jan 2015 23:05:27 -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=XHPuJhDVrXwKX12Sre0KGoU0Q63h8lj+D/EMtcuE9fg=; b=bpaNU8RBd//GjrQyXyIPaFYrsWl9H2s/UGgPPan0fOiEXaSx5sqG4eK2WtginDeJqE Mt3GH/OmaPh+inZw9ok723NJYQdfDi6agneE13R2ZiuwETwXAteAkPAvs8RhtEvGqpCJ bWPDjfRL0IPM3EJSk+AvUniX/tNvFbcdgPqldeUyCRr27ng4Fk/GaaBuGh7zZUhDU25Y ufeCPzNRH3wB3hFq7hUtiNfiHA/9CFtORlqMt82LS5nnCcuSX3yTL571J1Km5RVhCf/7 6gNi9aLf3jUWP6znTtfFSaRwmcPbTIU1UvhrOi+Vz4NnAS37/owudskeQcXvrjZo1DnE FWEg== X-Gm-Message-State: ALoCoQmky+uefNT3JAc6tMFVf0f3wnNcwY1gudXBj2kkMI05ehfo2UViGaw6PmVFHfsiwyx0xwgL X-Received: by 10.112.188.199 with SMTP id gc7mr554287lbc.6.1420182327528; Thu, 01 Jan 2015 23:05:27 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.5.135 with SMTP id s7ls2508847las.33.gmail; Thu, 01 Jan 2015 23:05:27 -0800 (PST) X-Received: by 10.152.19.71 with SMTP id c7mr74908720lae.79.1420182327258; Thu, 01 Jan 2015 23:05:27 -0800 (PST) Received: from mail-lb0-f175.google.com (mail-lb0-f175.google.com. [209.85.217.175]) by mx.google.com with ESMTPS id dd4si50485661lad.13.2015.01.01.23.05.26 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 01 Jan 2015 23:05:26 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.175 as permitted sender) client-ip=209.85.217.175; Received: by mail-lb0-f175.google.com with SMTP id z11so6754635lbi.20 for ; Thu, 01 Jan 2015 23:05:26 -0800 (PST) X-Received: by 10.152.23.38 with SMTP id j6mr75080693laf.81.1420182326749; Thu, 01 Jan 2015 23:05:26 -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.9.200 with SMTP id c8csp126139lbb; Thu, 1 Jan 2015 23:05:25 -0800 (PST) X-Received: by 10.70.92.3 with SMTP id ci3mr120704396pdb.28.1420182324944; Thu, 01 Jan 2015 23:05:24 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id dl1si29047854pbb.67.2015.01.01.23.05.23; Thu, 01 Jan 2015 23:05:24 -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 S1750747AbbABHFW (ORCPT + 12 others); Fri, 2 Jan 2015 02:05:22 -0500 Received: from mail-pa0-f53.google.com ([209.85.220.53]:37693 "EHLO mail-pa0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750744AbbABHFV (ORCPT ); Fri, 2 Jan 2015 02:05:21 -0500 Received: by mail-pa0-f53.google.com with SMTP id kq14so23337801pab.26 for ; Thu, 01 Jan 2015 23:05:21 -0800 (PST) X-Received: by 10.68.69.37 with SMTP id b5mr118658659pbu.102.1420182321033; Thu, 01 Jan 2015 23:05:21 -0800 (PST) Received: from localhost ([122.167.116.151]) by mx.google.com with ESMTPSA id lo3sm40202631pab.26.2015.01.01.23.05.19 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 01 Jan 2015 23:05:20 -0800 (PST) From: Viresh Kumar To: Rafael Wysocki Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, prarit@redhat.com, skannan@codeaurora.org, Viresh Kumar Subject: [PATCH 07/17] cpufreq: pass policy to cpufreq_out_of_sync Date: Fri, 2 Jan 2015 12:34:28 +0530 Message-Id: <8095637bb1e3b2b625eb016cea1a44469d4eb28c.1420181916.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.2.0 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.175 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: , There is no point finding out the 'policy' again within cpufreq_out_of_sync() when all the callers already have it. Just make them pass policy instead. Signed-off-by: Viresh Kumar --- drivers/cpufreq/cpufreq.c | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 5e60b3259cf5..3e80b97d64b8 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -1502,30 +1502,23 @@ static void handle_update(struct work_struct *work) /** * cpufreq_out_of_sync - If actual and saved CPU frequency differs, we're * in deep trouble. - * @cpu: cpu number - * @old_freq: CPU frequency the kernel thinks the CPU runs at + * @policy: policy managing CPUs * @new_freq: CPU frequency the CPU actually runs at * * We adjust to current frequency first, and need to clean up later. * So either call to cpufreq_update_policy() or schedule handle_update()). */ -static void cpufreq_out_of_sync(unsigned int cpu, unsigned int old_freq, +static void cpufreq_out_of_sync(struct cpufreq_policy *policy, unsigned int new_freq) { - struct cpufreq_policy *policy; struct cpufreq_freqs freqs; - unsigned long flags; pr_debug("Warning: CPU frequency out of sync: cpufreq and timing core thinks of %u, is %u kHz\n", - old_freq, new_freq); + policy->cur, new_freq); - freqs.old = old_freq; + freqs.old = policy->cur; freqs.new = new_freq; - read_lock_irqsave(&cpufreq_driver_lock, flags); - policy = per_cpu(cpufreq_cpu_data, cpu); - read_unlock_irqrestore(&cpufreq_driver_lock, flags); - cpufreq_freq_transition_begin(policy, &freqs); cpufreq_freq_transition_end(policy, &freqs, 0); } @@ -1590,7 +1583,7 @@ static unsigned int __cpufreq_get(unsigned int cpu) /* verify no discrepancy between actual and saved value exists */ if (unlikely(ret_freq != policy->cur)) { - cpufreq_out_of_sync(cpu, policy->cur, ret_freq); + cpufreq_out_of_sync(policy, ret_freq); schedule_work(&policy->update); } } @@ -2289,8 +2282,7 @@ int cpufreq_update_policy(unsigned int cpu) policy->cur = new_policy.cur; } else { if (policy->cur != new_policy.cur && has_target()) - cpufreq_out_of_sync(cpu, policy->cur, - new_policy.cur); + cpufreq_out_of_sync(policy, new_policy.cur); } }